From 74350f68e34b39c95db90137919e24f28a41ff71 Mon Sep 17 00:00:00 2001 From: a1danbryant Date: Tue, 13 May 2025 11:35:48 +0900 Subject: [PATCH 01/12] updates to test_persistence.R --- tests/test_persistence.R | 137 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100644 tests/test_persistence.R diff --git a/tests/test_persistence.R b/tests/test_persistence.R new file mode 100644 index 0000000..842ade4 --- /dev/null +++ b/tests/test_persistence.R @@ -0,0 +1,137 @@ +mat <- matrix(c(0, 1, 2, 1, 0.5, 2, 2, 1, 3), ncol = 3, byrow = TRUE) +colnames(mat) <- c("dimension", "birth", "death") +pd <- as_persistence(mat) +df <- data.frame( + dimension = c(1, 1, 1, 1, 1), + birth = c(1, .6, 1.3, 2.1, 1.99), + death = c(2, 1.2, .7, 4.2, 1.99) +) + + +#as_persistence.default correctly processes a basic matrix" +expect_inherits(pd, "persistence") +expect_equal(length(pd$pairs), 3) # 3 unique degrees (0,1,2) +expect_equal(unname(pd$pairs[[1]]), matrix(c(1, 2), ncol = 2), ignore_attr = TRUE) # Degree 0 +expect_equal(unname(pd$pairs[[2]]), matrix(c(0.5, 2), ncol = 2), ignore_attr = TRUE) # Degree 1 +expect_equal(unname(pd$pairs[[3]]), matrix(c(1, 3), ncol = 2), ignore_attr = TRUE) # Degree 2 + +#correctly processes output from `____$diag` from the {TDA} package +coords <- df[, c("birth", "death")] + +df3d <- t(data.frame( + w = c(1.1, -.2, 1.07), + x = c(1.3, 2.1, 1.99), + y = c(0.7, 4.2, 1.99), + z = c(0.2, 0.4, 0.35) +)) + +pd <- alphaComplexDiag(df3d, maxdimension = 1)$diagram +pd[, c(2, 3)] <- sqrt(pd[, c(2, 3)]) +pd_p <- as_persistence(pd) + +expect_inherits(pd_p, "persistence") +expect_equal(pd_p$metadata$parameters$maxdimension, 1) +expect_equal(length(pd_p$pairs[[1]][1, ]), 2) #correct Format + + +pd2 <- alphaShapeDiag(df3d, maxdimension = 2)$diagram +pd2[, c(2, 3)] <- sqrt(pd2[, c(2, 3)]) +pd_p2 <- as_persistence(pd2) + +expect_inherits(pd_p2, "persistence") +expect_equal(pd_p$metadata$parameters$maxdimension, 1) +expect_equal(length(pd_p2$pairs[[1]][1, ]), 2) #correct Format + + +FltRips <- ripsFiltration(X = df, maxdimension = 1, + maxscale = 1.5, dist = "euclidean", library = "Dionysus", + printProgress = FALSE) +DiagFltRips <- filtrationDiag(filtration = FltRips, maxdimension = 1, + library = "Dionysus", location = TRUE, printProgress = TRUE) +pd3 <- DiagFltRips$diagram +pd3[, c(2, 3)] <- sqrt(pd3[, c(2, 3)]) +pd_p3 <- as_persistence(pd3) + +expect_inherits(pd_p3, "persistence") +expect_equal(pd_p3$metadata$parameters$maxdimension, 1) +expect_equal(length(pd_p3$pairs[[1]][1, ]), 2) #correct Format + + +Diag1 <- gridDiag(coords, distFct, lim = cbind(c(-1, 1), c(-1, 1)), maxdimension = 1 ,by = 0.05, sublevel = TRUE, + printProgress = TRUE) +pd4 <- Diag1$diagram +pd4[, c(2, 3)] <- sqrt(pd4[, c(2, 3)]) +pd_p4 <- as_persistence(pd4) + +expect_inherits(pd_p4, "persistence") +expect_equal(pd_p4$metadata$parameters$maxdimension, 1) +expect_equal(length(pd_p4$pairs[[1]][1, ]), 2) #correct Format + + +pd5 <- ripsDiag(df, maxdimension = 1, maxscale = 10)$diagram +pd5[, c(2, 3)] <- sqrt(pd5[, c(2, 3)]) +pd_p5 <- as_persistence(pd5) + +expect_inherits(pd_p5, "persistence") +expect_equal(length(pd_p5$pairs), 1) +expect_equal(length(pd_p5$pairs[[1]][1, ]), 2) #correct Format + + +#as_persistence.PHom correctly processes output from `vietoris_rips` from {ripserr} +pd <- ripserr::cubical(volcano) +pd_p <- as_persistence(pd) + +expect_inherits(pd_p, "persistence") + +rip_ver <- as.character(utils::packageVersion("ripserr")) + +if (utils::compareVersion(rip_ver, "0.3.0") >= 0) { + #ripserr ≥ 0.3.0 + expect_inherits(pd_p, "persistence") + expect_equal(pd_p$metadata$parameters$maxdimension, 1) + expect_equal(length(pd_p$pairs[[1]][1, ]), 2) +} else { + #ripserr < 0.3.0 + expect_inherits(pd_p, "persistence") + expect_equal(pd_p$metadata$max_dim, 1) + expect_equal(length(pd_p$pairs[[1]][1, ]), 2) +} + + +#as_persistence.list handles a list of matrices correctly" +pd <- as_persistence(list(matrix(c(1, 2), ncol = 2), matrix(c(0.5, 2), ncol = 2))) + +expect_inherits(pd, "persistence") +expect_equal(length(pd$pairs), 2) #Two degrees (0 and 1) +expect_equal(pd$pairs[[1]], matrix(c(1, 2), ncol = 2)) +expect_equal(pd$pairs[[2]], matrix(c(0.5, 2), ncol = 2)) + + + +#as_persistence.persistence returns the object unchanged +mat <- matrix(c(0, 1, 2, 1, 0.5, 2), ncol = 3, byrow = TRUE) +pd <- as_persistence(mat) +pd2 <- as_persistence(pd) + +expect_identical(pd, pd2) + + + +#as.data.frame.persistence creates correct format +mat <- matrix(c(0, 1, 2, 1, 0.5, 2), ncol = 3, byrow = TRUE) +colnames(mat) <- c("dimension", "birth", "death") +pd <- as_persistence(mat) +df <- as.data.frame(pd) + +expect_inherits(df, "data.frame") +expect_equal(colnames(df), c("dimension", "birth", "death")) +expect_equal(as.numeric(df[1, ]), c(0, 1, 2)) + + +#`get_pairs` correctly grabs pairs from persistence object + +pd_p <- as_persistence(pd) +expect_equal(get_pairs(pd_p, 1), pd_p$pairs[[2]]) +expect_true(all(is.na(get_pairs(pd_p, 3)))) #nonexistent dimension returns empty matrix +expect_error(get_pairs(pd)) #verifies failure given incorrect class + From 7b942dd3cad7b9ecd769fa6ed40aa301b97b90fd Mon Sep 17 00:00:00 2001 From: a1danb <124316415+a1danbryant@users.noreply.github.com> Date: Tue, 13 May 2025 11:51:22 +0900 Subject: [PATCH 02/12] Rename test_persistence.R to test-persistence.R --- tests/{test_persistence.R => test-persistence.R} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename tests/{test_persistence.R => test-persistence.R} (100%) diff --git a/tests/test_persistence.R b/tests/test-persistence.R similarity index 100% rename from tests/test_persistence.R rename to tests/test-persistence.R From dd55325a7216e1a52d376c792fb67badd41eaa2f Mon Sep 17 00:00:00 2001 From: a1danb <124316415+a1danbryant@users.noreply.github.com> Date: Tue, 13 May 2025 11:55:10 +0900 Subject: [PATCH 03/12] small change in verbiage test-persistence.R --- tests/test-persistence.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test-persistence.R b/tests/test-persistence.R index 842ade4..a6f3503 100644 --- a/tests/test-persistence.R +++ b/tests/test-persistence.R @@ -77,7 +77,7 @@ expect_equal(length(pd_p5$pairs), 1) expect_equal(length(pd_p5$pairs[[1]][1, ]), 2) #correct Format -#as_persistence.PHom correctly processes output from `vietoris_rips` from {ripserr} +#as_persistence.PHom correctly processes output from {ripserr} pd <- ripserr::cubical(volcano) pd_p <- as_persistence(pd) From bc5ed21cd246802fcb735f72c5431a565bb819b2 Mon Sep 17 00:00:00 2001 From: a1danbryant Date: Wed, 14 May 2025 13:10:34 +0900 Subject: [PATCH 04/12] rename and relocation --- inst/tinytest/test-persistence.R | 135 +++++++++++++++++++++++++++++++ 1 file changed, 135 insertions(+) create mode 100644 inst/tinytest/test-persistence.R diff --git a/inst/tinytest/test-persistence.R b/inst/tinytest/test-persistence.R new file mode 100644 index 0000000..db4f4c9 --- /dev/null +++ b/inst/tinytest/test-persistence.R @@ -0,0 +1,135 @@ +mat <- matrix(c(0, 1, 2, 1, 0.5, 2, 2, 1, 3), ncol = 3, byrow = TRUE) +colnames(mat) <- c("dimension", "birth", "death") +pd <- as_persistence(mat) +df <- data.frame( + dimension = c(1, 1, 1, 1, 1), + birth = c(1, .6, 1.3, 2.1, 1.99), + death = c(2, 1.2, .7, 4.2, 1.99) +) + + +#as_persistence.default correctly processes a basic matrix" +expect_inherits(pd, "persistence") +expect_equal(length(pd$pairs), 3) # 3 unique degrees (0,1,2) +expect_equal(unname(pd$pairs[[1]]), matrix(c(1, 2), ncol = 2), ignore_attr = TRUE) # Degree 0 +expect_equal(unname(pd$pairs[[2]]), matrix(c(0.5, 2), ncol = 2), ignore_attr = TRUE) # Degree 1 +expect_equal(unname(pd$pairs[[3]]), matrix(c(1, 3), ncol = 2), ignore_attr = TRUE) # Degree 2 + +#correctly processes output from `____$diag` from the {TDA} package +coords <- df[, c("birth", "death")] + +df3d <- t(data.frame( + w = c(1.1, -.2, 1.07), + x = c(1.3, 2.1, 1.99), + y = c(0.7, 4.2, 1.99), + z = c(0.2, 0.4, 0.35) +)) + +pd <- alphaComplexDiag(df3d, maxdimension = 1)$diagram +pd[, c(2, 3)] <- sqrt(pd[, c(2, 3)]) +pd_p <- as_persistence(pd) + +expect_inherits(pd_p, "persistence") +expect_equal(pd_p$metadata$parameters$maxdimension, 1) +expect_equal(length(pd_p$pairs[[1]][1, ]), 2) #correct Format + + +pd2 <- alphaShapeDiag(df3d, maxdimension = 2)$diagram +pd2[, c(2, 3)] <- sqrt(pd2[, c(2, 3)]) +pd_p2 <- as_persistence(pd2) + +expect_inherits(pd_p2, "persistence") +expect_equal(pd_p$metadata$parameters$maxdimension, 1) +expect_equal(length(pd_p2$pairs[[1]][1, ]), 2) #correct Format + + +FltRips <- ripsFiltration(X = df, maxdimension = 1, + maxscale = 1.5, dist = "euclidean", library = "Dionysus", + printProgress = FALSE) +DiagFltRips <- filtrationDiag(filtration = FltRips, maxdimension = 1, + library = "Dionysus", location = TRUE, printProgress = TRUE) +pd3 <- DiagFltRips$diagram +pd3[, c(2, 3)] <- sqrt(pd3[, c(2, 3)]) +pd_p3 <- as_persistence(pd3) + +expect_inherits(pd_p3, "persistence") +expect_equal(pd_p3$metadata$parameters$maxdimension, 1) +expect_equal(length(pd_p3$pairs[[1]][1, ]), 2) #correct Format + + +Diag1 <- gridDiag(coords, distFct, lim = cbind(c(-1, 1), c(-1, 1)), maxdimension = 1 ,by = 0.05, sublevel = TRUE, + printProgress = TRUE) +pd4 <- Diag1$diagram +pd4[, c(2, 3)] <- sqrt(pd4[, c(2, 3)]) +pd_p4 <- as_persistence(pd4) + +expect_inherits(pd_p4, "persistence") +expect_equal(pd_p4$metadata$parameters$maxdimension, 1) +expect_equal(length(pd_p4$pairs[[1]][1, ]), 2) #correct Format + + +pd5 <- ripsDiag(df, maxdimension = 1, maxscale = 10)$diagram +pd5[, c(2, 3)] <- sqrt(pd5[, c(2, 3)]) +pd_p5 <- as_persistence(pd5) + +expect_inherits(pd_p5, "persistence") +expect_equal(length(pd_p5$pairs), 1) +expect_equal(length(pd_p5$pairs[[1]][1, ]), 2) #correct Format + + +#as_persistence.PHom correctly processes output from `vietoris_rips` from {ripserr} +pd <- ripserr::cubical(volcano) +pd_p <- as_persistence(pd) + +rip_ver <- as.character(utils::packageVersion("ripserr")) + +if (utils::compareVersion(rip_ver, "0.3.0") >= 0) { + #ripserr ≥ 0.3.0 + expect_inherits(pd_p, "persistence") + expect_equal(pd_p$metadata$parameters$maxdimension, 1) + expect_equal(length(pd_p$pairs[[1]][1, ]), 2) +} else { + #ripserr < 0.3.0 + expect_inherits(pd_p, "persistence") + expect_equal(pd_p$metadata$parameters$maxdimension, 1) + expect_equal(length(pd_p$pairs[[1]][1, ]), 2) +} + + +#as_persistence.list handles a list of matrices correctly" +pd <- as_persistence(list(matrix(c(1, 2), ncol = 2), matrix(c(0.5, 2), ncol = 2))) + +expect_inherits(pd, "persistence") +expect_equal(length(pd$pairs), 2) #Two degrees (0 and 1) +expect_equal(pd$pairs[[1]], matrix(c(1, 2), ncol = 2)) +expect_equal(pd$pairs[[2]], matrix(c(0.5, 2), ncol = 2)) + + + +#as_persistence.persistence returns the object unchanged +mat <- matrix(c(0, 1, 2, 1, 0.5, 2), ncol = 3, byrow = TRUE) +pd <- as_persistence(mat) +pd2 <- as_persistence(pd) + +expect_identical(pd, pd2) + + + +#as.data.frame.persistence creates correct format +mat <- matrix(c(0, 1, 2, 1, 0.5, 2), ncol = 3, byrow = TRUE) +colnames(mat) <- c("dimension", "birth", "death") +pd <- as_persistence(mat) +df <- as.data.frame(pd) + +expect_inherits(df, "data.frame") +expect_equal(colnames(df), c("dimension", "birth", "death")) +expect_equal(as.numeric(df[1, ]), c(0, 1, 2)) + + +#`get_pairs` correctly grabs pairs from persistence object + +pd_p <- as_persistence(pd) +expect_equal(get_pairs(pd_p, 1), pd_p$pairs[[2]]) +expect_true(all(is.na(get_pairs(pd_p, 3)))) #nonexistent dimension returns empty matrix +expect_error(get_pairs(pd)) #verifies failure given incorrect class + From 6c667c2803d01be327d905fc7f167b8800945205 Mon Sep 17 00:00:00 2001 From: a1danbryant Date: Wed, 14 May 2025 13:16:46 +0900 Subject: [PATCH 05/12] removed tests/test-persistence.R --- tests/test-persistence.R | 137 --------------------------------------- 1 file changed, 137 deletions(-) delete mode 100644 tests/test-persistence.R diff --git a/tests/test-persistence.R b/tests/test-persistence.R deleted file mode 100644 index a6f3503..0000000 --- a/tests/test-persistence.R +++ /dev/null @@ -1,137 +0,0 @@ -mat <- matrix(c(0, 1, 2, 1, 0.5, 2, 2, 1, 3), ncol = 3, byrow = TRUE) -colnames(mat) <- c("dimension", "birth", "death") -pd <- as_persistence(mat) -df <- data.frame( - dimension = c(1, 1, 1, 1, 1), - birth = c(1, .6, 1.3, 2.1, 1.99), - death = c(2, 1.2, .7, 4.2, 1.99) -) - - -#as_persistence.default correctly processes a basic matrix" -expect_inherits(pd, "persistence") -expect_equal(length(pd$pairs), 3) # 3 unique degrees (0,1,2) -expect_equal(unname(pd$pairs[[1]]), matrix(c(1, 2), ncol = 2), ignore_attr = TRUE) # Degree 0 -expect_equal(unname(pd$pairs[[2]]), matrix(c(0.5, 2), ncol = 2), ignore_attr = TRUE) # Degree 1 -expect_equal(unname(pd$pairs[[3]]), matrix(c(1, 3), ncol = 2), ignore_attr = TRUE) # Degree 2 - -#correctly processes output from `____$diag` from the {TDA} package -coords <- df[, c("birth", "death")] - -df3d <- t(data.frame( - w = c(1.1, -.2, 1.07), - x = c(1.3, 2.1, 1.99), - y = c(0.7, 4.2, 1.99), - z = c(0.2, 0.4, 0.35) -)) - -pd <- alphaComplexDiag(df3d, maxdimension = 1)$diagram -pd[, c(2, 3)] <- sqrt(pd[, c(2, 3)]) -pd_p <- as_persistence(pd) - -expect_inherits(pd_p, "persistence") -expect_equal(pd_p$metadata$parameters$maxdimension, 1) -expect_equal(length(pd_p$pairs[[1]][1, ]), 2) #correct Format - - -pd2 <- alphaShapeDiag(df3d, maxdimension = 2)$diagram -pd2[, c(2, 3)] <- sqrt(pd2[, c(2, 3)]) -pd_p2 <- as_persistence(pd2) - -expect_inherits(pd_p2, "persistence") -expect_equal(pd_p$metadata$parameters$maxdimension, 1) -expect_equal(length(pd_p2$pairs[[1]][1, ]), 2) #correct Format - - -FltRips <- ripsFiltration(X = df, maxdimension = 1, - maxscale = 1.5, dist = "euclidean", library = "Dionysus", - printProgress = FALSE) -DiagFltRips <- filtrationDiag(filtration = FltRips, maxdimension = 1, - library = "Dionysus", location = TRUE, printProgress = TRUE) -pd3 <- DiagFltRips$diagram -pd3[, c(2, 3)] <- sqrt(pd3[, c(2, 3)]) -pd_p3 <- as_persistence(pd3) - -expect_inherits(pd_p3, "persistence") -expect_equal(pd_p3$metadata$parameters$maxdimension, 1) -expect_equal(length(pd_p3$pairs[[1]][1, ]), 2) #correct Format - - -Diag1 <- gridDiag(coords, distFct, lim = cbind(c(-1, 1), c(-1, 1)), maxdimension = 1 ,by = 0.05, sublevel = TRUE, - printProgress = TRUE) -pd4 <- Diag1$diagram -pd4[, c(2, 3)] <- sqrt(pd4[, c(2, 3)]) -pd_p4 <- as_persistence(pd4) - -expect_inherits(pd_p4, "persistence") -expect_equal(pd_p4$metadata$parameters$maxdimension, 1) -expect_equal(length(pd_p4$pairs[[1]][1, ]), 2) #correct Format - - -pd5 <- ripsDiag(df, maxdimension = 1, maxscale = 10)$diagram -pd5[, c(2, 3)] <- sqrt(pd5[, c(2, 3)]) -pd_p5 <- as_persistence(pd5) - -expect_inherits(pd_p5, "persistence") -expect_equal(length(pd_p5$pairs), 1) -expect_equal(length(pd_p5$pairs[[1]][1, ]), 2) #correct Format - - -#as_persistence.PHom correctly processes output from {ripserr} -pd <- ripserr::cubical(volcano) -pd_p <- as_persistence(pd) - -expect_inherits(pd_p, "persistence") - -rip_ver <- as.character(utils::packageVersion("ripserr")) - -if (utils::compareVersion(rip_ver, "0.3.0") >= 0) { - #ripserr ≥ 0.3.0 - expect_inherits(pd_p, "persistence") - expect_equal(pd_p$metadata$parameters$maxdimension, 1) - expect_equal(length(pd_p$pairs[[1]][1, ]), 2) -} else { - #ripserr < 0.3.0 - expect_inherits(pd_p, "persistence") - expect_equal(pd_p$metadata$max_dim, 1) - expect_equal(length(pd_p$pairs[[1]][1, ]), 2) -} - - -#as_persistence.list handles a list of matrices correctly" -pd <- as_persistence(list(matrix(c(1, 2), ncol = 2), matrix(c(0.5, 2), ncol = 2))) - -expect_inherits(pd, "persistence") -expect_equal(length(pd$pairs), 2) #Two degrees (0 and 1) -expect_equal(pd$pairs[[1]], matrix(c(1, 2), ncol = 2)) -expect_equal(pd$pairs[[2]], matrix(c(0.5, 2), ncol = 2)) - - - -#as_persistence.persistence returns the object unchanged -mat <- matrix(c(0, 1, 2, 1, 0.5, 2), ncol = 3, byrow = TRUE) -pd <- as_persistence(mat) -pd2 <- as_persistence(pd) - -expect_identical(pd, pd2) - - - -#as.data.frame.persistence creates correct format -mat <- matrix(c(0, 1, 2, 1, 0.5, 2), ncol = 3, byrow = TRUE) -colnames(mat) <- c("dimension", "birth", "death") -pd <- as_persistence(mat) -df <- as.data.frame(pd) - -expect_inherits(df, "data.frame") -expect_equal(colnames(df), c("dimension", "birth", "death")) -expect_equal(as.numeric(df[1, ]), c(0, 1, 2)) - - -#`get_pairs` correctly grabs pairs from persistence object - -pd_p <- as_persistence(pd) -expect_equal(get_pairs(pd_p, 1), pd_p$pairs[[2]]) -expect_true(all(is.na(get_pairs(pd_p, 3)))) #nonexistent dimension returns empty matrix -expect_error(get_pairs(pd)) #verifies failure given incorrect class - From 83619180d1473b039c9f489cce4aef79d84c4c97 Mon Sep 17 00:00:00 2001 From: a1danbryant Date: Sat, 17 May 2025 15:02:39 +0900 Subject: [PATCH 06/12] test fix for .PHom class --- inst/tinytest/test-persistence.R | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/inst/tinytest/test-persistence.R b/inst/tinytest/test-persistence.R index db4f4c9..d5e80d1 100644 --- a/inst/tinytest/test-persistence.R +++ b/inst/tinytest/test-persistence.R @@ -77,7 +77,7 @@ expect_equal(length(pd_p5$pairs), 1) expect_equal(length(pd_p5$pairs[[1]][1, ]), 2) #correct Format -#as_persistence.PHom correctly processes output from `vietoris_rips` from {ripserr} +#as_persistence.PHom correctly processes output from `ripserr::cubical` from {ripserr} pd <- ripserr::cubical(volcano) pd_p <- as_persistence(pd) @@ -86,12 +86,14 @@ rip_ver <- as.character(utils::packageVersion("ripserr")) if (utils::compareVersion(rip_ver, "0.3.0") >= 0) { #ripserr ≥ 0.3.0 expect_inherits(pd_p, "persistence") - expect_equal(pd_p$metadata$parameters$maxdimension, 1) + expect_equal(pd_p$metadata$engine, "ripserr::") + expect_equal(pd_p$metadata$filtration, "Vietoris-Rips/cubical") expect_equal(length(pd_p$pairs[[1]][1, ]), 2) } else { #ripserr < 0.3.0 expect_inherits(pd_p, "persistence") - expect_equal(pd_p$metadata$parameters$maxdimension, 1) + expect_equal(pd_p$metadata$engine, "ripserr::") + expect_equal(pd_p$metadata$filtration, "Vietoris-Rips/cubical") expect_equal(length(pd_p$pairs[[1]][1, ]), 2) } @@ -108,6 +110,7 @@ expect_equal(pd$pairs[[2]], matrix(c(0.5, 2), ncol = 2)) #as_persistence.persistence returns the object unchanged mat <- matrix(c(0, 1, 2, 1, 0.5, 2), ncol = 3, byrow = TRUE) +colnames(mat) <- c("dimension", "birth", "death") pd <- as_persistence(mat) pd2 <- as_persistence(pd) From 10ea81ce869dfb39bb4c2d4a8cad342c31c3bba9 Mon Sep 17 00:00:00 2001 From: a1danbryant Date: Sat, 24 May 2025 14:20:58 +0900 Subject: [PATCH 07/12] TDA:: prefix added --- inst/tinytest/test-persistence.R | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/inst/tinytest/test-persistence.R b/inst/tinytest/test-persistence.R index d5e80d1..abcdd5a 100644 --- a/inst/tinytest/test-persistence.R +++ b/inst/tinytest/test-persistence.R @@ -25,7 +25,7 @@ df3d <- t(data.frame( z = c(0.2, 0.4, 0.35) )) -pd <- alphaComplexDiag(df3d, maxdimension = 1)$diagram +pd <- TDA::alphaComplexDiag(df3d, maxdimension = 1)$diagram pd[, c(2, 3)] <- sqrt(pd[, c(2, 3)]) pd_p <- as_persistence(pd) @@ -34,7 +34,7 @@ expect_equal(pd_p$metadata$parameters$maxdimension, 1) expect_equal(length(pd_p$pairs[[1]][1, ]), 2) #correct Format -pd2 <- alphaShapeDiag(df3d, maxdimension = 2)$diagram +pd2 <- TDA::alphaShapeDiag(df3d, maxdimension = 2)$diagram pd2[, c(2, 3)] <- sqrt(pd2[, c(2, 3)]) pd_p2 <- as_persistence(pd2) @@ -43,10 +43,10 @@ expect_equal(pd_p$metadata$parameters$maxdimension, 1) expect_equal(length(pd_p2$pairs[[1]][1, ]), 2) #correct Format -FltRips <- ripsFiltration(X = df, maxdimension = 1, +FltRips <- TDA::ripsFiltration(X = df, maxdimension = 1, maxscale = 1.5, dist = "euclidean", library = "Dionysus", printProgress = FALSE) -DiagFltRips <- filtrationDiag(filtration = FltRips, maxdimension = 1, +DiagFltRips <- TDA::filtrationDiag(filtration = FltRips, maxdimension = 1, library = "Dionysus", location = TRUE, printProgress = TRUE) pd3 <- DiagFltRips$diagram pd3[, c(2, 3)] <- sqrt(pd3[, c(2, 3)]) @@ -57,7 +57,7 @@ expect_equal(pd_p3$metadata$parameters$maxdimension, 1) expect_equal(length(pd_p3$pairs[[1]][1, ]), 2) #correct Format -Diag1 <- gridDiag(coords, distFct, lim = cbind(c(-1, 1), c(-1, 1)), maxdimension = 1 ,by = 0.05, sublevel = TRUE, +Diag1 <- TDA::gridDiag(coords, distFct, lim = cbind(c(-1, 1), c(-1, 1)), maxdimension = 1 ,by = 0.05, sublevel = TRUE, printProgress = TRUE) pd4 <- Diag1$diagram pd4[, c(2, 3)] <- sqrt(pd4[, c(2, 3)]) @@ -68,7 +68,7 @@ expect_equal(pd_p4$metadata$parameters$maxdimension, 1) expect_equal(length(pd_p4$pairs[[1]][1, ]), 2) #correct Format -pd5 <- ripsDiag(df, maxdimension = 1, maxscale = 10)$diagram +pd5 <- TDA::ripsDiag(df, maxdimension = 1, maxscale = 10)$diagram pd5[, c(2, 3)] <- sqrt(pd5[, c(2, 3)]) pd_p5 <- as_persistence(pd5) From 08e0c78c768c27abec5bbb148c45782b1bbaf6fe Mon Sep 17 00:00:00 2001 From: a1danbryant Date: Sat, 24 May 2025 14:31:07 +0900 Subject: [PATCH 08/12] TDA:: prefix addition --- inst/tinytest/test-persistence.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inst/tinytest/test-persistence.R b/inst/tinytest/test-persistence.R index abcdd5a..215510d 100644 --- a/inst/tinytest/test-persistence.R +++ b/inst/tinytest/test-persistence.R @@ -57,7 +57,7 @@ expect_equal(pd_p3$metadata$parameters$maxdimension, 1) expect_equal(length(pd_p3$pairs[[1]][1, ]), 2) #correct Format -Diag1 <- TDA::gridDiag(coords, distFct, lim = cbind(c(-1, 1), c(-1, 1)), maxdimension = 1 ,by = 0.05, sublevel = TRUE, +Diag1 <- TDA::gridDiag(coords, TDA::distFct, lim = cbind(c(-1, 1), c(-1, 1)), maxdimension = 1 ,by = 0.05, sublevel = TRUE, printProgress = TRUE) pd4 <- Diag1$diagram pd4[, c(2, 3)] <- sqrt(pd4[, c(2, 3)]) From c550e76134e0dbbfec8911697e3d4e9f0cc83686 Mon Sep 17 00:00:00 2001 From: a1danbryant Date: Sat, 24 May 2025 15:07:01 +0900 Subject: [PATCH 09/12] print progress false --- inst/tinytest/test-persistence.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inst/tinytest/test-persistence.R b/inst/tinytest/test-persistence.R index 215510d..bb918dc 100644 --- a/inst/tinytest/test-persistence.R +++ b/inst/tinytest/test-persistence.R @@ -47,7 +47,7 @@ FltRips <- TDA::ripsFiltration(X = df, maxdimension = 1, maxscale = 1.5, dist = "euclidean", library = "Dionysus", printProgress = FALSE) DiagFltRips <- TDA::filtrationDiag(filtration = FltRips, maxdimension = 1, - library = "Dionysus", location = TRUE, printProgress = TRUE) + library = "Dionysus", location = TRUE, printProgress = FALSE) pd3 <- DiagFltRips$diagram pd3[, c(2, 3)] <- sqrt(pd3[, c(2, 3)]) pd_p3 <- as_persistence(pd3) From d184c89bbe002c79b13a9fbe2b33ce918aa5fefa Mon Sep 17 00:00:00 2001 From: a1danbryant Date: Sat, 24 May 2025 15:08:28 +0900 Subject: [PATCH 10/12] print progress false --- inst/tinytest/test-persistence.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inst/tinytest/test-persistence.R b/inst/tinytest/test-persistence.R index bb918dc..9b0efa2 100644 --- a/inst/tinytest/test-persistence.R +++ b/inst/tinytest/test-persistence.R @@ -58,7 +58,7 @@ expect_equal(length(pd_p3$pairs[[1]][1, ]), 2) #correct Format Diag1 <- TDA::gridDiag(coords, TDA::distFct, lim = cbind(c(-1, 1), c(-1, 1)), maxdimension = 1 ,by = 0.05, sublevel = TRUE, - printProgress = TRUE) + printProgress = FALSE) pd4 <- Diag1$diagram pd4[, c(2, 3)] <- sqrt(pd4[, c(2, 3)]) pd_p4 <- as_persistence(pd4) From f7dad3f6bcf6fe5198b8d071a72fb7e43f853826 Mon Sep 17 00:00:00 2001 From: Aymeric Stamm Date: Tue, 30 Sep 2025 15:54:37 +0200 Subject: [PATCH 11/12] Upgrade version of roxygen --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 2d02630..7a590f0 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -11,7 +11,7 @@ Description: Implements a class for hosting persistence homology information in License: GPL (>= 3) Encoding: UTF-8 Roxygen: list(markdown = TRUE) -RoxygenNote: 7.3.2 +RoxygenNote: 7.3.3 URL: https://github.com/tdaverse/phutil, https://tdaverse.github.io/phutil/ BugReports: https://github.com/tdaverse/phutil/issues Depends: From 02f02fc049ad3474ff954a000830ad607cf87acb Mon Sep 17 00:00:00 2001 From: Aymeric Stamm Date: Wed, 1 Oct 2025 11:54:10 +0200 Subject: [PATCH 12/12] Add ripserr package as suggested dependency --- DESCRIPTION | 1 + 1 file changed, 1 insertion(+) diff --git a/DESCRIPTION b/DESCRIPTION index 16e81e5..f6e98c2 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -34,6 +34,7 @@ Suggests: knitr, microbenchmark, quarto, + ripserr, TDA, tdaunif, tinysnapshot,