Skip to content

Commit 914935d

Browse files
remove multithreads in gdal_warp
1 parent a1bcc2e commit 914935d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+578
-255
lines changed

DESCRIPTION

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@ Collate:
135135
'api_file.R'
136136
'api_gdal.R'
137137
'api_gdalcubes.R'
138-
'api_imputation.R'
139138
'api_jobs.R'
140139
'api_label_class.R'
141140
'api_mixture_model.R'
@@ -213,6 +212,7 @@ Collate:
213212
'sits_filters.R'
214213
'sits_geo_dist.R'
215214
'sits_get_data.R'
215+
'sits_imputation.R'
216216
'sits_labels.R'
217217
'sits_label_classification.R'
218218
'sits_lighttae.R'

NAMESPACE

+2
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,7 @@ S3method(summary,sits_accuracy)
394394
S3method(summary,sits_area_accuracy)
395395
export("sits_bands<-")
396396
export("sits_labels<-")
397+
export(impute_linear)
397398
export(sits_accuracy)
398399
export(sits_accuracy_summary)
399400
export(sits_apply)
@@ -422,6 +423,7 @@ export(sits_formula_linear)
422423
export(sits_formula_logref)
423424
export(sits_geo_dist)
424425
export(sits_get_data)
426+
export(sits_impute)
425427
export(sits_kfold_validate)
426428
export(sits_label_classification)
427429
export(sits_labels)

R/api_apply.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
)
8181
# Get band configuration
8282
band_conf <- .tile_band_conf(tile = feature, band = out_band)
83-
if (!.has(band_conf)) {
83+
if (.has_not(band_conf)) {
8484
if (normalized)
8585
band_conf <- .conf("default_values", "INT2S")
8686
else

R/api_band.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@
112112
#' @param bands band names (may be lower or upper case)
113113
#' @return band names in case required by SITS
114114
.band_set_case <- function(bands) {
115-
if (!purrr::is_null(bands)) {
115+
if (.has(bands)) {
116116
if (all(tolower(bands) %in% .conf("sits_results_bands"))) {
117117
bands <- tolower(bands)
118118
} else {

R/api_check.R

+7-13
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@
263263
return(NULL)
264264
})
265265
# return error if data is not accessible
266-
.check_that(!purrr::is_null(robj),
266+
.check_that(.has(robj),
267267
msg = "Invalid data cube - missing files"
268268
)
269269
return(invisible(x))
@@ -1449,7 +1449,7 @@
14491449
#' @keywords internal
14501450
#' @noRd
14511451
.check_cube_is_results_cube <- function(bands, labels) {
1452-
if (!purrr::is_null(bands) &&
1452+
if (.has(bands) &&
14531453
all(bands %in% .conf("sits_results_bands"))) {
14541454
results_cube <- TRUE
14551455
} else {
@@ -1885,7 +1885,7 @@
18851885
)
18861886
}
18871887
# Ensures that a spatial filter is informed
1888-
if (!.has(roi) && !.has(tiles)) {
1888+
if (.has_not(roi) && .has_not(tiles)) {
18891889
stop(
18901890
"No spatial search criteria.",
18911891
"Please provide roi or tiles."
@@ -2323,11 +2323,7 @@
23232323
#' @noRd
23242324
.check_view_bands_params <- function(band, red, green, blue) {
23252325
.check_that(
2326-
!(purrr::is_null(band)) ||
2327-
(!(purrr::is_null(red)) &&
2328-
!(purrr::is_null(green)) &&
2329-
!(purrr::is_null(blue))
2330-
),
2326+
.has(band) || (.has(red) && .has(green) && .has(blue)),
23312327
local_msg = paste0(
23322328
"either 'band' parameter or 'red', 'green', and",
23332329
"'blue' parameters should be informed"
@@ -2345,7 +2341,7 @@
23452341
#' @keywords internal
23462342
#' @noRd
23472343
.check_view_bands <- function(cube, band, red, green, blue) {
2348-
if (!purrr::is_null(band)) {
2344+
if (.has(band)) {
23492345
# check band is available
23502346
.check_chr_within(
23512347
band,
@@ -2354,9 +2350,7 @@
23542350
msg = "invalid BW band"
23552351
)
23562352
}
2357-
if (!(purrr::is_null(red)) &&
2358-
!(purrr::is_null(green)) &&
2359-
!(purrr::is_null(blue))) {
2353+
if (.has(red) && .has(green) && .has(blue)) {
23602354
bands <- c(red, green, blue)
23612355
# check bands are available
23622356
.check_chr_within(
@@ -2386,7 +2380,7 @@
23862380

23872381
.check_default_message <- function(x, msg = NULL) {
23882382
# make default message
2389-
if (purrr::is_null(msg)) {
2383+
if (.has_not(msg)) {
23902384
# get x as expression
23912385
x_expr <- deparse(substitute(x, environment()))
23922386
msg <- paste0("invalid '", x_expr, "' parameter")

0 commit comments

Comments
 (0)