Fix(uncertainty): allow explicit MCMC and distribution paths; avoid o…#3663
Closed
shbhmexe wants to merge 2 commits intoPecanProject:developfrom
Closed
Fix(uncertainty): allow explicit MCMC and distribution paths; avoid o…#3663shbhmexe wants to merge 2 commits intoPecanProject:developfrom
shbhmexe wants to merge 2 commits intoPecanProject:developfrom
Conversation
…verloading pft$outdir as an input Updated get.parameter.samples() to accept explicit per-PFT paths for posterior distributions and MCMC samples, avoiding the use of pft$outdir as an input source unless no explicit path is provided. This change decouples input artifact locations from output directories, reduces accidental mixing of inputs and outputs, and maintains backward compatibility with previous usage.
Member
|
See #3662 for problem description and design discussion that has continued after this PR was started |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.