JGCRI / hector

The Hector Simple Climate Model
http://jgcri.github.io/hector/
GNU General Public License v3.0
111 stars 47 forks source link

multiple-biomes.Rmd fails #628

Closed kdorheim closed 2 years ago

kdorheim commented 2 years ago

I am having issues with the multiple-biomes.Rmd script failing. When I try to run ./vignettes/articles/multiple-biomes.Rmd the script errors early on related to some error with warmingfactor in the split_biome call. @bpbond is this potentially related to #627 ?

The problem

> knitr::opts_chunk$set(echo = TRUE)
> library(hector)
> library(ggplot2)
> ssp245 <- system.file("input", "hector_ssp245.ini", package = "hector")
> core <- newcore(ssp245, suppresslogging = TRUE)
> invisible(run(core, 2100))
> result_vars <- c(CONCENTRATIONS_CO2(), RF_TOTAL(), GLOBAL_TAS(),
+                  VEG_C(), SOIL_C(), DETRITUS_C())
> reference_results <- fetchvars(core, 2000:2100, result_vars, scenario = "reference")
> split_biome(core, "global", c("low-latitude", "high-latitude"),
+             fveg_c = c(0.9, 0.1),
+             fdetritus_c = c(0.9, 0.1),
+             fsoil_c = c(0.6, 0.4),
+             warmingfactor = c(1, 2.5))
Error in (function (core, biome, veg_c0, detritus_c0, soil_c0, npp_flux0,  : 
  formal argument "warmingfactor" matched by multiple actual arguments

Sesson Info

 sessionInfo()
R version 4.1.2 (2021-11-01)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Catalina 10.15.7

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] ggplot2_3.3.5 hector_3.0.0 

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.8.3      prettyunits_1.1.1 ps_1.6.0          rprojroot_2.0.2   digest_0.6.28     utf8_1.2.2       
 [7] mime_0.12         R6_2.5.1          evaluate_0.14     httr_1.4.2        pillar_1.6.4      rlang_0.4.12     
[13] curl_4.3.2        rstudioapi_0.13   whisker_0.4       callr_3.7.0       rmarkdown_2.11    pkgdown_2.0.2    
[19] labeling_0.4.2    desc_1.4.0        devtools_2.4.3    servr_0.24        stringr_1.4.0     munsell_0.5.0    
[25] compiler_4.1.2    httpuv_1.6.4      xfun_0.29         pkgconfig_2.0.3   pkgbuild_1.2.1    htmltools_0.5.2  
[31] downlit_0.4.0     tidyselect_1.1.1  tibble_3.1.6      roxygen2_7.1.2    fansi_1.0.2       crayon_1.4.2     
[37] dplyr_1.0.7       withr_2.4.3       later_1.3.0       BH_1.78.0-0       grid_4.1.2        jsonlite_1.7.2   
[43] gtable_0.3.0      lifecycle_1.0.1   magrittr_2.0.1    scales_1.1.1      cli_3.1.0         stringi_1.7.6    
[49] cachem_1.0.6      farver_2.1.0      fs_1.5.1          promises_1.2.0.1  remotes_2.4.2     testthat_3.1.0   
[55] xml2_1.3.3        ellipsis_0.3.2    vctrs_0.3.8       generics_0.1.1    tools_4.1.2       glue_1.6.0       
[61] purrr_0.3.4       processx_3.5.2    pkgload_1.2.4     fastmap_1.1.0     yaml_2.2.1        colorspace_2.0-2 
[67] sessioninfo_1.2.1 memoise_2.0.1     knitr_1.36        usethis_2.1.3    
bpbond commented 2 years ago

@kdorheim I think this has been fixed in d5981de , just pushed to #624 .

Question back to you: when I do devtools::build_vignettes() nothing happens (it returns NULL). 😕 why?

kdorheim commented 2 years ago

Aggh that is because as part of getting Hector CRAN compliant it went from being a vignette to an article so would run it with the pkgdown::build_articles() and because of the way that the github actions branches are set up this isn't running for the dev3 branch bleh