Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ inst/doc
# Generated by configure (see src/Makevars.in) and ./configure
src/Makevars
inst/include/

/.quarto/
**/*.quarto_ipynb
9 changes: 5 additions & 4 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

## Bug fixes

- Adjusted vendored Hera sources to explicitly include missing headers that are not pulled in transitively in latest clang versions; adapted R-CMD-check action to exercise this along the way.
- Aligned vendored sources with upstream repository at https://github.com/animetov/hera; actually currently aligned with https://github.com/astamm/hera@r-compatibility with PR awaiting approval.
- Use a `configure` script to mirror the vendored Hera headers as *forwarding headers* in `inst/include` and generate `Makevars` from `Makevars.in` (via `abs_srcdir`) so the upstream `<hera/...>` includes resolve without modifying the vendored sources; a `cleanup` script then removes these generated artifacts, keeping them out of version control (see `src/README.md`).
- Define hera's `FOR_R_TDA` flag (in `src/Makevars.in`) to suppress the upstream `std::cerr`/`std::cout` diagnostics, satisfying R's requirement that compiled code not write to stdout/stderr.
- Adjusted vendored Hera sources to explicitly include missing headers that are not pulled in transitively in latest clang versions; adapted R-CMD-check action to exercise this along the way (#62).
- Aligned vendored sources with upstream repository at https://github.com/animetov/hera; actually currently aligned with https://github.com/astamm/hera@r-compatibility with PR awaiting approval.
- Use a `configure` script to mirror the vendored Hera headers as *forwarding headers* in `inst/include` and generate `Makevars` from `Makevars.in` (via `abs_srcdir`) so the upstream `<hera/...>` includes resolve without modifying the vendored sources; a `cleanup` script then removes these generated artifacts, keeping them out of version control (see `src/README.md`).
- Define hera's `FOR_R_TDA` flag (in `src/Makevars.in`) to suppress the upstream `std::cerr`/`std::cout` diagnostics, satisfying R's requirement that compiled code not write to stdout/stderr.
- `as_persistence.diagram()` would fail when the input was obtained through `do.call()`; it now continues without error, but with empty information about the engine (#58).

# phutil 0.0.2

Expand Down
2 changes: 2 additions & 0 deletions R/persistence-class.R
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,8 @@ as_persistence.diagram <- function(x, warn = TRUE, ...) {
bd_cols <- match(c("Birth", "Death"), info$dimnames[[2L]])

filt_nm <- gsub("*Diag", "", rlang::call_name(info$call))
# when using `do.call()`, call does not include `TDA::*Diag()`
if (length(filt_nm) == 0L) filt_nm <- ""
if (filt_nm == "rips") {
filt_nm <- "Vietoris-Rips"
}
Expand Down
4 changes: 4 additions & 0 deletions inst/tinytest/test-persistence-class.R
Original file line number Diff line number Diff line change
Expand Up @@ -191,4 +191,8 @@ if (requireNamespace("ripserr", quietly = TRUE)) {
expect_true(!is.list(as_diagram(h, list = FALSE)))
}

# tolerate `do.call()` input
ph <- do.call(TDA::ripsDiag, c(list(X = x, maxdimension = 2, maxscale = 10)))
expect_silent(as_persistence(ph))

options(opts)
Loading