@@ -253,10 +253,14 @@ sits_classify.raster_cube <- function(data,
253
253
.check_filter_fn(filter_fn )
254
254
# Retrieve the samples from the model
255
255
samples <- .ml_samples(ml_model )
256
- # Retrieve bands from the model
257
- base_bands <- intersect(
258
- .ml_bands(ml_model ), .cube_bands(.cube_base_info(data ))
259
- )
256
+ # By default, base bands is null.
257
+ base_bands <- NULL
258
+ if (.cube_is_base(data )) {
259
+ # Get base bands
260
+ base_bands <- intersect(
261
+ .ml_bands(ml_model ), .cube_bands(.cube_base_info(data ))
262
+ )
263
+ }
260
264
# get non-base bands
261
265
bands <- setdiff(.ml_bands(ml_model ), base_bands )
262
266
# Do the samples and tile match their timeline length?
@@ -270,8 +274,12 @@ sits_classify.raster_cube <- function(data,
270
274
job_size = .block_size(block = block , overlap = 0 ),
271
275
npaths = (
272
276
length(.tile_paths(data , bands )) +
273
- length(.tile_paths(.cube_base_info(data ), base_bands )) +
274
- length(.ml_labels(ml_model ))
277
+ length(.ml_labels(ml_model )) +
278
+ ifelse(
279
+ test = .cube_is_base(data ),
280
+ yes = length(.tile_paths(.cube_base_info(data ), base_bands )),
281
+ no = 0
282
+ )
275
283
),
276
284
nbytes = 8 ,
277
285
proc_bloat = proc_bloat
0 commit comments