From 4bb4da30836a55604c48a1db132271fb5a202a74 Mon Sep 17 00:00:00 2001 From: gilbertocamara Date: Sat, 26 Aug 2023 09:26:34 -0300 Subject: [PATCH] configuration adjustments --- R/api_gdal.R | 2 +- check_package_cran.R | 60 +++++++++++++++++++ inst/extdata/config_axelspace.yml | 96 +++++++++++++++++++++++++++++++ inst/extdata/config_internals.yml | 9 --- 4 files changed, 157 insertions(+), 10 deletions(-) create mode 100644 check_package_cran.R create mode 100644 inst/extdata/config_axelspace.yml diff --git a/R/api_gdal.R b/R/api_gdal.R index 64202c6b5..07e85e245 100644 --- a/R/api_gdal.R +++ b/R/api_gdal.R @@ -68,7 +68,7 @@ #' @noRd #' @param file File to be created (with path) #' @param base_file File to be copied from (with path) -#' @param param GDAL parameters +#' @param params GDAL parameters #' @param quiet TRUE/FALSE #' @returns Called for side effects .gdal_translate <- function(file, base_file, params, quiet) { diff --git a/check_package_cran.R b/check_package_cran.R new file mode 100644 index 000000000..46b392765 --- /dev/null +++ b/check_package_cran.R @@ -0,0 +1,60 @@ +# Prepare for CRAN ---- + +# Update dependencies in DESCRIPTION +attachment::att_amend_desc() + +# Run tests and examples outside of CRAN +devtools::test() +devtools::run_examples(run_dontrun = TRUE) + +# Check package as CRAN +rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran")) + +# Check content +# remotes::install_github("ThinkR-open/checkhelper") +#checkhelper::find_missing_tags() + +# Check spelling +# usethis::use_spell_check() +spelling::spell_check_package() + +# Check URL are correct +# remotes::install_github("r-lib/urlchecker") +urlchecker::url_check() +urlchecker::url_update() + +# check on other distributions +# _rhub +devtools::check_rhub() +rhub::check_for_cran() +# _win devel +devtools::check_win_devel() +devtools::check_win_release() +# Check reverse dependencies +# remotes::install_github("r-lib/revdepcheck") +usethis::use_git_ignore("revdep/") +usethis::use_build_ignore("revdep/") + +devtools::revdep() +library(revdepcheck) +# In another session +id <- rstudioapi::terminalExecute("Rscript -e 'revdepcheck::revdep_check(num_workers = 4)'") +rstudioapi::terminalKill(id) +# See outputs +revdep_details(revdep = "pkg") +revdep_summary() # table of results by package +revdep_report() # in revdep/ +# Clean up when on CRAN +revdep_reset() + +# Update NEWS +# Bump version manually and add list of changes + +# Add comments for CRAN +usethis::use_cran_comments(open = rlang::is_interactive()) + +# Upgrade version number +usethis::use_version(which = c("patch", "minor", "major", "dev")[1]) + +# Verify you're ready for release, and release +devtools::release() diff --git a/inst/extdata/config_axelspace.yml b/inst/extdata/config_axelspace.yml new file mode 100644 index 000000000..d17c400c9 --- /dev/null +++ b/inst/extdata/config_axelspace.yml @@ -0,0 +1,96 @@ +sources: + AXELSPACE : + s3_class : ["stac_cube", "eo_cube", "raster_cube"] + service : "STAC" + url : "https://brazildatacube.dpi.inpe.br/stac/" + collections : + GRUS : &grus + bands : + PAN : &grus_pan + missing_value : 0 + minimum_value : 1 + maximum_value : 10000 + scale_factor : 0.0001 + offset_value : 0 + resolution : 2.5 + band_name : "Panchromatic" + data_type : "INT2S" + BLUE : &grus_blue + missing_value : 0 + minimum_value : 1 + maximum_value : 10000 + scale_factor : 0.0001 + offset_value : 0 + resolution : 5 + band_name : "Blue" + data_type : "INT2S" + GREEN : + <<: *grus_blue + band_name : "Green" + RED : + <<: *grus_blue + band_name : "Red" + RED-EDGE : + <<: *grus_blue + band_name : "Red Edge" + NIR : + <<: *grus_blue + band_name : "Near Infrared" + CLOUD : &bdc_awfi_cloud + bit_mask : false + band_name : "CMASK" + values : + 0 : "No Data" + 127 : "Clear Pixel" + 255 : "Cloud" + interp_values : [0, 255] + resolution : 64 + data_type : "INT1U" + satellite : "CBERS-4" + sensor : "WFI" + collection_name: "CB4-16D-2" + token_vars : ["BDC_ACCESS_KEY"] + open_data : true + open_data_token : true + metadata_search : "tile" + ext_tolerance: 0.01 + grid_system : "BDC-Large V2" + CBERS-WFI-8D : + bands : + NDVI : + <<: *bdc_awfi_ndvi + band_name : "NDVI" + EVI : + <<: *bdc_awfi_ndvi + band_name : "EVI" + B13 : + <<: *bdc_awfi_b13 + missing_value : -9999 + minimum_value : 0 + maximum_value : 10000 + scale_factor : 0.0001 + offset_value : 0 + resolution : 64 + band_name : "BAND13" + data_type : "INT2S" + B14 : + <<: *bdc_awfi_b13 + band_name : "BAND14" + B15 : + <<: *bdc_awfi_b13 + band_name : "BAND15" + B16 : + <<: *bdc_awfi_b13 + band_name : "BAND16" + CLOUD : + <<: *bdc_awfi_cloud + band_name : "CMASK" + satellite : "CBERS-4-4A" + sensor : "WFI" + collection_name: "CBERS-WFI_64_8D_LCF-1" + token_vars : ["BDC_ACCESS_KEY"] + open_data : true + open_data_token : true + metadata_search : "tile" + ext_tolerance: 0.01 + grid_system : "BDC-Large V2" diff --git a/inst/extdata/config_internals.yml b/inst/extdata/config_internals.yml index 2fd6802ad..3bb8b4fea 100644 --- a/inst/extdata/config_internals.yml +++ b/inst/extdata/config_internals.yml @@ -1,13 +1,4 @@ # Internal configuration parameters - relevant only to sits developers -# s3 classes known to sits -sits_s3_classes : ["sits", "patterns", "predicted", "sits_model", - "raster_cube", "probs_cube", - "uncertainty_cube", "class_cube", - "stac_cube", "bdc_cube", "aws_cube", - "usgs_cube", "deafrica_cube"] - -# s3 classes resulting from classification and post-classification -sits_s3_classes_proc : ["probs_cube","uncertainty_cube", "class_cube", "variance_cube"] # bands resulting from classification and post-classification sits_results_bands : ["probs", "bayes", "uncert", "entropy",