Fix(uncertainty): allow explicit MCMC and distribution paths; avoid o… #3663
+37
−9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Title: fix(uncertainty): allow explicit MCMC and distribution paths; avoid overloading pft$outdir as an input
What was fixed or enhanced:
get.parameter.samples()implicitly treatedpft$outdiras an input source for bothpost.distns.Rdataandtrait.mcmc.Rdata. This forced read-only calibration artifacts to be placed/mixed in output directories. The function now supports explicit, per‑PFT input paths and only falls back topft$outdirwhen nothing is provided.Why the change was necessary:
pft$outdiris primarily for outputs. This reduces confusion and accidental overwrites and enables using externally curated calibration results without copying them into PEcAn’s output tree.What exact changes were made:
modules/uncertainty/R/get.parameter.samples.Rto:posterior.filesas either a vector of distribution files (backward compatible) or a list of lists per PFT with named entriesdistributionand/ormcmc.posterior.files[[i]]$mcmcis provided, load that MCMC directly and skip anypft$outdir/DB fallback; preserve PDA correlation handling.posterior.files[[i]]$distributionis provided, load it directly; otherwise, fall back to the most recentpost.distns.Rdatainpft$outdir, thenprior.distns.Rdata.How it improves the project:
Verification steps:
samples.Rdatais written undersettings$outdirand that no files are read frompft$outdirwhen explicit paths are provided.posterior.files = NAand confirm previous fallback behavior still works.Next steps (optional, not included in this PR):
settings$meta.analysisandsettings$sensitivity.analysisblocks respectively, to fully eliminate the input/output overloading risk.Modified Files
modules/uncertainty/R/get.parameter.samples.R✅ pushNo config or environment files were added.