From 801bb849b8789f0b9a674917e95be29f5bf4cc27 Mon Sep 17 00:00:00 2001 From: Lambda Moses Date: Wed, 31 Jul 2024 16:08:25 -0400 Subject: [PATCH] Get rid of warnings --- tests/testthat/test-image.R | 4 ++-- tests/testthat/test-subset.R | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/testthat/test-image.R b/tests/testthat/test-image.R index 587e7fea..f35a5b48 100644 --- a/tests/testthat/test-image.R +++ b/tests/testthat/test-image.R @@ -176,7 +176,7 @@ test_that("transposeImg, SpatRasterImage method", { expect_equal(d[2], 13) # Save to file - fn <- normalizePath(file.path(getwd(), "foo.tif")) + fn <- normalizePath(file.path(getwd(), "foo.tif"), mustWork = FALSE) img_t3 <- transposeImg(img, filename = fn) expect_equal(dim(img)[1:2], dim(img_t3)[2:1]) expect_equal(imgSource(img_t3), fn) @@ -200,7 +200,7 @@ test_that("mirrorImg, SpatRasterImage method", { expect_equal(imgRaster(img_m2)[10,3,2][[1]], 190) # Use filename - fn <- normalizePath(file.path(getwd(), "foo.tif")) + fn <- normalizePath(file.path(getwd(), "foo.tif"), mustWork = FALSE) img_m3 <- mirrorImg(img, filename = "foo.tif") expect_equal(imgSource(img_m3), fn) expect_true(file.exists(fn)) diff --git a/tests/testthat/test-subset.R b/tests/testthat/test-subset.R index 30b8b688..8ecebe93 100644 --- a/tests/testthat/test-subset.R +++ b/tests/testthat/test-subset.R @@ -134,7 +134,7 @@ inds <- c(rep(TRUE, ncol(sfe1)), not_singleton) test_that("Images are cropped after subsetting, multiple samples", { sfe3 <- sfe[,inds] - cg <- st_centroid(spotPoly(sfe3, sample_id = "all")) + cg <- st_centroid(st_geometry(spotPoly(sfe3, sample_id = "all"))) nCounts <- Matrix::colSums(counts(sfe3)) # For sample 1 img1 <- getImg(sfe3, sample_id = "ob") |> imgRaster()