Skip to content

Commit

Permalink
Get rid of warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
lambdamoses committed Jul 31, 2024
1 parent 6229db1 commit 801bb84
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions tests/testthat/test-image.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-subset.R
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 801bb84

Please sign in to comment.