Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ For more information about this file see also [Keep a Changelog](http://keepacha
- Added statewide synthetic fertilization and compost amendment event workflows for CA ag parcels. Outputs share an ensemble naming so a downstream cleaner unions them into one fertilization event type for SIPNET.

### Fixed
- `PEcAn.uncertainty::sa_run_descriptions()` now preserves all PFT names in multi-PFT median `paramlist`s instead of dropping PFTs after the first (#4290).
- `PEcAn.uncertainty::read.ensemble.output()` uses `NA` for missing variables, so each member’s result uses only its own output (#4204).
- Fixed broken meteorological data, flux network, and API documentation links in the PEcAn book and data.atmosphere package (#4071).
- `PEcAn.uncertainty::generate_joint_ensemble_design(sobol = TRUE)` now errors on looped inputs and quasi-random parameter methods, which split into dependent `X1` and `X2` halves and gave wrong Sobol indices (#4134).
Expand Down
1 change: 1 addition & 0 deletions modules/uncertainty/NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# PEcAn.uncertainty 1.9.0.9000

* `sa_run_descriptions()` now joins multiple PFT names with `collapse = ","` so median `paramlist`s preserve every PFT (#4290).
* `read.ensemble.output()` uses `NA` for missing variables, so each member’s result uses only its own output (#4204).
* `generate_joint_ensemble_design(sobol = TRUE)` now errors when an input is sampled by `"looping"` or parameters by `"halton"` or `"sobol"`. These split into dependent `X1` and `X2` halves and gave wrong Sobol indices (#4134).
* In `run.sensitivity.analysis()`, load `samples` once before the variables loop, avoiding repeated disk reads (#3859).
Expand Down
4 changes: 2 additions & 2 deletions modules/uncertainty/R/sa_run_samples.R
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ sa_run_descriptions <- function(design_matrix, site_id, pft_names) {
ids[row] <- PEcAn.utils::get.run.id("SA", "median", site.id = site_id)
paramlists[row] <- paste0(
"quantile=MEDIAN,trait=all,pft=",
paste(pft_names, sep = ",")
)[1]
paste(pft_names, collapse = ",")
)
} else {
quantile <- as.numeric(design_matrix$sa_quantile[row]) / 100
ids[row] <- PEcAn.utils::get.run.id(
Expand Down
9 changes: 9 additions & 0 deletions modules/uncertainty/tests/testthat/test-sa_run_samples.R
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,15 @@ test_that("the median run is named for what it is", {
expect_match(ids$paramlist[1], "quantile=MEDIAN,trait=all")
})

test_that("the median run preserves all PFT names in paramlist", {
ids <- sa_run_descriptions(
sa_design_fixture(),
site_id = "772",
pft_names = c("pft1", "pft2")
)

expect_equal(ids$paramlist[1], "quantile=MEDIAN,trait=all,pft=pft1,pft2")
})

test_that("a moved run is named for the trait and quantile it moves", {
ids <- sa_run_descriptions(sa_design_fixture(), site_id = "772", pft_names = "pft1")
Expand Down
Loading