Skip to content

Commit a5295f2

Browse files
Merge pull request #1287 from M3nin0/dc-methods-doc
fix docs and raster api call
2 parents 641bd65 + 7563c8b commit a5295f2

File tree

2 files changed

+30
-9
lines changed

2 files changed

+30
-9
lines changed

R/api_detect_change.R

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -235,14 +235,15 @@
235235
.detect_change_tile_prep <- function(dc_method, tile, ...) {
236236
UseMethod(".detect_change_tile_prep", dc_method)
237237
}
238-
#' @rdname .detect_change_tile_prep
238+
#' @noRd
239239
#' @export
240240
.detect_change_tile_prep.default <- function(dc_method, tile, ...) {
241241
return(NULL)
242242
}
243-
#' @rdname .detect_change_tile_prep
243+
#' @noRd
244244
#' @export
245-
.detect_change_tile_prep.bayts_model <- function(dc_method, tile, ..., impute_fn) {
245+
.detect_change_tile_prep.bayts_model <-
246+
function(dc_method, tile, ..., impute_fn) {
246247
deseasonlize <- environment(dc_method)[["deseasonlize"]]
247248

248249
if (!.has(deseasonlize)) {
@@ -273,6 +274,14 @@
273274
})
274275
do.call(cbind, quantile_values)
275276
}
277+
#' @title Pre-process tile to run detect_change method (bayts)
278+
#' @name .detect_change_create_timeline
279+
#' @keywords internal
280+
#' @noRd
281+
#' @param dc_method Detect change method
282+
#' @param tile Single tile of a data cube.
283+
#' @param ... Additional parameters
284+
#' @param impute_fn Imputation function
276285
.detect_change_create_timeline <- function(tile) {
277286
# Get the number of dates in the timeline
278287
tile_tl <- .as_chr(.tile_timeline(tile))
@@ -282,7 +291,8 @@
282291
)
283292
tile_tl
284293
}
285-
294+
#' @name .detect_change_as_polygon
295+
#' @noRd
286296
.detect_change_as_polygon <- function(values, block, bbox) {
287297
# Create a template raster
288298
template_raster <- .raster_new_rast(
@@ -306,7 +316,13 @@
306316
# Return the segment object
307317
return(values)
308318
}
309-
319+
#' @rdname .dc_samples
320+
#' @title Retrieve samples available in a given detect change method.
321+
#' @name .dc_samples
322+
#' @keywords internal
323+
#' @noRd
324+
#' @param dc_method Detect change method
325+
#' @return Samples available in the dc method.
310326
.dc_samples <- function(dc_method) {
311327
environment(dc_method)[["samples"]]
312328
}
@@ -319,12 +335,12 @@
319335
.dc_bands <- function(dc_method) {
320336
UseMethod(".dc_bands", dc_method)
321337
}
322-
#' @rdname .dc_bands
338+
#' @noRd
323339
#' @export
324340
.dc_bands.sits_model <- function(dc_method) {
325341
.samples_bands(.dc_samples(dc_method))
326342
}
327-
#' @rdname .dc_bands
343+
#' @noRd
328344
#' @export
329345
.dc_bands.bayts_model <- function(dc_method) {
330346
if (.has(.dc_samples(dc_method))) {
@@ -334,7 +350,12 @@
334350
stats <- unlist(lapply(stats, colnames))
335351
return(unique(stats))
336352
}
337-
353+
#' @title Retrieve bands associated to detect_change method
354+
#' @name .dc_class
355+
#' @keywords internal
356+
#' @noRd
357+
#' @param dc_method Detect change method
358+
#' @return Class of the model.
338359
.dc_class <- function(dc_method) {
339360
class(dc_method)[[1]]
340361
}

R/api_raster.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@
429429
.raster_check_block(block = block)
430430
}
431431
# create raster objects
432-
r_obj <- .raster_open_rast.terra(file = path.expand(files), ...)
432+
r_obj <- .raster_open_rast(file = path.expand(files), ...)
433433

434434
# start read
435435
if (.has_not(block)) {

0 commit comments

Comments
 (0)