diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index a29163b..9c27a51 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -1,7 +1,10 @@ # Workflow derived from https://github.com/r-lib/actions/tree/v2/examples # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help -on: [push, pull_request] - +on: + push: + branches: [main, master] + pull_request: + name: R-CMD-check jobs: diff --git a/NEWS.md b/NEWS.md index 3acde75..50688d0 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,10 @@ # anndata 0.7.5.6 -* BUG FIX: Use the right interface for the `all.equal()` function. +* BUG FIX: Use the right interface for the `all.equal()` function (PR #32). + +* BUG FIX: Add `py_to_r` converter for `anndata.abc._AbstractCSDataset` (PR #34). + +* MINOR CHANGES: Ignore python warnings when running tests (PR #34). # anndata 0.7.5.5 diff --git a/R/reticulate_conversions.R b/R/reticulate_conversions.R index 145d96c..a1a2480 100644 --- a/R/reticulate_conversions.R +++ b/R/reticulate_conversions.R @@ -100,6 +100,10 @@ py_to_r.scipy.sparse.csc.csc_matrix <- function(x) { ) } +py_to_r.anndata.abc._AbstractCSDataset <- function(x) { + py_to_r_ifneedbe(x$to_memory()) +} + # TODO: could add mapping specifically for: # * adpy$layers: anndata._core.aligned_mapping.Layers # * adpy$obsm: anndata._core.aligned_mapping.AxisArrays diff --git a/tests/testthat/test-anndata.R b/tests/testthat/test-anndata.R index 2cf4fc6..0bc0c45 100644 --- a/tests/testthat/test-anndata.R +++ b/tests/testthat/test-anndata.R @@ -2,6 +2,9 @@ context("testing AnnData") skip_if_no_anndata() +warnings <- reticulate::import("warnings") +warnings$filterwarnings("ignore") + ad <- AnnData( X = matrix(0:5, nrow = 2), obs = data.frame(group = c("a", "b"), row.names = c("s1", "s2")), diff --git a/tests/testthat/test-backed_sparse.R b/tests/testthat/test-backed_sparse.R index 61da3bf..edb1feb 100644 --- a/tests/testthat/test-backed_sparse.R +++ b/tests/testthat/test-backed_sparse.R @@ -2,6 +2,8 @@ context("testing backed mode") skip_if_no_anndata() +warnings <- reticulate::import("warnings") +warnings$filterwarnings("ignore") test_that("backed indexing", { tmp_path <- tempfile() diff --git a/tests/testthat/test-base.R b/tests/testthat/test-base.R index 5a4fe2f..f71f292 100644 --- a/tests/testthat/test-base.R +++ b/tests/testthat/test-base.R @@ -2,6 +2,9 @@ context("testing the base functionality") skip_if_no_anndata() +warnings <- reticulate::import("warnings") +warnings$filterwarnings("ignore") + # some test objects that we use below adata_dense <- AnnData(rbind(c(1, 2), c(3, 4))) adata_dense$layers["test"] <- adata_dense$X @@ -311,6 +314,7 @@ test_that("boolean_slicing", { }) test_that("oob boolean slicing", { + skip_if(tolower(Sys.info()[["sysname"]]) == "darwin") # skip on macOS len <- sample.int(50, 2, replace = FALSE) expect_error( { diff --git a/tests/testthat/test-concat.R b/tests/testthat/test-concat.R index b5fe706..4958dc3 100644 --- a/tests/testthat/test-concat.R +++ b/tests/testthat/test-concat.R @@ -2,6 +2,9 @@ context("testing concat()") skip_if_no_anndata() +warnings <- reticulate::import("warnings") +warnings$filterwarnings("ignore") + a <- AnnData( X = matrix(c(0, 1, 2, 3), nrow = 2, byrow = TRUE), obs = data.frame(group = c("a", "b"), row.names = c("s1", "s2")),