Skip to content

Commit

Permalink
fix problems in testing because of new check_cube_is_regular
Browse files Browse the repository at this point in the history
  • Loading branch information
gilbertocamara committed Jan 31, 2025
1 parent 10e4102 commit 4a2b116
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
3 changes: 2 additions & 1 deletion R/sits_classify.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
#' (c) extreme gradient boosting: \code{\link[sits]{sits_xgboost}};
#' (d) multi-layer perceptrons: \code{\link[sits]{sits_mlp}};
#' (e) 1D CNN: \code{\link[sits]{sits_tempcnn}};
#' (f) self-attention encoders: \code{\link[sits]{sits_lighttae}}.
#' (f) self-attention encoders: \code{\link[sits]{sits_lighttae}} and
#' \code{\link[sits]{sits_tae}}
#'
#' @param data Data cube (tibble of class "raster_cube")
#' @param ml_model R model trained by \code{\link[sits]{sits_train}}
Expand Down
1 change: 1 addition & 0 deletions sits.Rproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Version: 1.0
ProjectId: 76abb56a-743d-4b6e-954a-5f1649964a84

RestoreWorkspace: Default
SaveWorkspace: Ask
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-file_info.R
Original file line number Diff line number Diff line change
Expand Up @@ -135,5 +135,5 @@ test_that("file_info errors", {
# file info
expect_s3_class(.fi(s2_cube), "tbl_df")

expect_false(.cube_is_regular(s2_cube))
expect_false(.check_cube_is_regular(s2_cube))
})
6 changes: 3 additions & 3 deletions tests/testthat/test-regularize.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ test_that("Regularizing cubes from AWS, and extracting samples from them", {
"AWS is not accessible"
)

expect_false(.cube_is_regular(s2_cube_open))
expect_false(.check_cube_is_regular(s2_cube_open))
expect_true(all(sits_bands(s2_cube_open) %in% c("B8A", "CLOUD")))

timelines <- suppressWarnings(sits_timeline(s2_cube_open))
Expand Down Expand Up @@ -112,7 +112,7 @@ test_that("Creating Landsat cubes from MPC", {
testthat::skip_if(purrr::is_null(landsat_cube), "MPC is not accessible")

expect_true(all(sits_bands(landsat_cube) %in% c("NIR08", "CLOUD")))
expect_false(.cube_is_regular(landsat_cube))
expect_false(.check_cube_is_regular(landsat_cube))
expect_true(any(grepl("LT05", landsat_cube$file_info[[1]]$fid)))
expect_true(any(grepl("LE07", landsat_cube$file_info[[1]]$fid)))

Expand All @@ -136,7 +136,7 @@ test_that("Creating Landsat cubes from MPC", {
expect_equal(.tile_nrows(.tile(rg_landsat)), 856)
expect_equal(.tile_ncols(.tile(rg_landsat)), 967)

expect_true(.cube_is_regular(rg_landsat))
expect_true(.check_cube_is_regular(rg_landsat))

l5_cube <- .try(
{
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-segmentation.R
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ test_that("Segmentation of large files",{
output_dir = output_dir
)
)
expect_true(.cube_is_regular(modis_cube_local))
expect_true(.check_cube_is_regular(modis_cube_local))
expect_true(all(sits_bands(modis_cube_local) %in% c("EVI", "NDVI")))
segments <- sits_segment(
cube = modis_cube_local,
Expand Down

0 comments on commit 4a2b116

Please sign in to comment.