Description of the bug
Helper_InputChecker returns misspecified input when DateStop is equal to the upper bound of the dataset time range. This seems due to the fact that the function compares the input as a POSIXct object, which has a time zone attached, to the allowed value, a character string without time zone. For instance, the function then evaluates the comparison of the two strings "2100-12-31 UTC" > "2100-12-31", which is technically true due to the longer string, but should of course return false.
Reproducing the bug
Self-contained minimal working example in R to reproduce the issue.
bar <- Access_KlimaiNorge2100(variable="surface_total_snow_amount", dateStart="2100-12-30", dateStop="2100-12-31", extent=c(19.5, 20, 68, 68.5), method="3dbc-eqm", model="noresm-r1i1p1f1-hclim", scenario="ssp370")
# returns Error in Helper_InputChecker(inputCheck = InCheck_ls) :
# Your function input seems misspecified. Request validation fails for Time. Please reinvestigate your specification of this/these argument(s).
Expected behavior
Function should allow data retrieval for the upper bound date.
Session Information
R version 4.4.2 (2024-10-31)
Platform: x86_64-pc-linux-gnu
Running under: Red Hat Enterprise Linux 8.10 (Ootpa)
Matrix products: default
BLAS/LAPACK: FlexiBLAS OPENBLAS; LAPACK version 3.12.0
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
time zone: Europe/Oslo
tzcode source: system (glibc)
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] ncdfCF_0.8.2 ClimHub_0.1.15
loaded via a namespace (and not attached):
[1] tidyselect_1.2.1 Exact_3.3 viridisLite_0.4.3
[4] rootSolve_1.8.2.4 dplyr_1.2.0 farver_2.1.2
[7] viridis_0.6.5 S7_0.2.1 fastmap_1.2.0
[10] timechange_0.4.0 lifecycle_1.0.5 sf_1.1-0
[13] lmom_3.2 terra_1.8-93 magrittr_2.0.4
[16] compiler_4.4.2 rlang_1.1.7 progress_1.2.3
[19] doSNOW_1.0.20 tools_4.4.2 data.table_1.18.2.1
[22] prettyunits_1.2.0 curl_7.0.0 classInt_0.4-11
[25] xml2_1.5.2 RColorBrewer_1.1-3 abind_1.4-8
[28] KernSmooth_2.23-26 expm_1.0-0 withr_3.0.2
[31] purrr_1.2.1 grid_4.4.2 tidyterra_1.0.0
[34] e1071_1.7-17 ggplot2_4.0.2 scales_1.4.0
[37] iterators_1.0.14 MASS_7.3-65 dichromat_2.0-0.1
[40] cli_3.6.5 mvtnorm_1.3-3 crayon_1.5.3
[43] generics_0.1.4 rstudioapi_0.18.0 httr_1.4.8
[46] tzdb_0.5.0 ncdf4_1.24 readxl_1.4.5
[49] gld_2.6.8 DBI_1.3.0 cachem_1.1.0
[52] proxy_0.4-29 ecmwfr_2.0.3 stringr_1.6.0
[55] rvest_1.0.5 parallel_4.4.2 selectr_0.5-1
[58] cellranger_1.1.0 vctrs_0.7.1 boot_1.3-32
[61] Matrix_1.7-4 jsonlite_2.0.0 hms_1.1.4
[64] foreach_1.5.2 tidyr_1.3.2 units_1.0-0
[67] snow_0.4-4 glue_1.8.0 RNetCDF_2.11-1
[70] codetools_0.2-20 lubridate_1.9.5 stringi_1.8.7
[73] gtable_0.3.6 tibble_3.3.1 pillar_1.11.1
[76] R6_2.6.1 lattice_0.22-7 haven_2.5.5
[79] readr_2.1.5 memoise_2.0.1 class_7.3-23
[82] DescTools_0.99.60 Rcpp_1.1.1 CFtime_1.7.2
[85] gridExtra_2.3 fs_1.6.6 forcats_1.0.1
[88] pkgconfig_2.0.3
Description of the bug
Helper_InputChecker returns misspecified input when DateStop is equal to the upper bound of the dataset time range. This seems due to the fact that the function compares the input as a POSIXct object, which has a time zone attached, to the allowed value, a character string without time zone. For instance, the function then evaluates the comparison of the two strings "2100-12-31 UTC" > "2100-12-31", which is technically true due to the longer string, but should of course return false.
Reproducing the bug
Self-contained minimal working example in R to reproduce the issue.
Expected behavior
Function should allow data retrieval for the upper bound date.
Session Information