diff --git a/.gitignore b/.gitignore index a3f498c..ef2ea9e 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,6 @@ inst/doc # Generated by configure (see src/Makevars.in) and ./configure src/Makevars inst/include/ + +/.quarto/ +**/*.quarto_ipynb diff --git a/NEWS.md b/NEWS.md index 29fb99b..baf6faf 100644 --- a/NEWS.md +++ b/NEWS.md @@ -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 `` 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 `` 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 diff --git a/R/persistence-class.R b/R/persistence-class.R index c7025c5..20aa32e 100644 --- a/R/persistence-class.R +++ b/R/persistence-class.R @@ -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" } diff --git a/inst/tinytest/test-persistence-class.R b/inst/tinytest/test-persistence-class.R index 8fe3caf..35046d7 100644 --- a/inst/tinytest/test-persistence-class.R +++ b/inst/tinytest/test-persistence-class.R @@ -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)