Skip to content

Conversation

@ashiklom
Copy link
Member

Description

The PEcAn.MA::run.meta.analysis.pft function has a lot of file I/O and some database interactions that make it difficult to run without the full PEcAn infrastructure. At the same time, PEcAn.MA::pecan.ma is missing some useful pre- and post- checking and data processing. This introduces an intermediate function --- meta_analysis_standalone --- that includes the logic of run.meta.analysis.pft but without the extra I/O and database interactions.

run.meta.analysis.pft has been refactored to be a thin wrapper around meta_analysis_standalone along with some file I/O. A minor breaking change is that all file writing now happens after meta_analysis_standalone runs (e.g., before, jagged.data was written to disk right after being created but before the meta-analysis was executed; now it's saved after the entire meta-analysis runs).

I also added a short new vignette that shows how this function can be used. The Quarto notebook in #3707 can be a more complete version of this.

Motivation and Context

See discussion in #3718. Also related to open PR #3707.

Review Time Estimate

  • Immediately
  • Within one week
  • When possible

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation.
  • My name is in the list of CITATION.cff
  • I agree that PEcAn Project may distribute my contribution under any or all of
    • the same license as the existing code,
    • and/or the BSD 3-clause license.
  • I have updated the CHANGELOG.md.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
    • The new vignette sort-of functions as a mini integration test.
  • All new and existing tests passed.
    • NOTE: I ran the PEcAn.MA tests, but not the full suite of PEcAn tests. I was hoping the CI could do that for me; otherwise, if there's a quick set of tests I can run on my local machine, let me know what the current best practice is for doing that.

@ashiklom
Copy link
Member Author

I introduced at least one bug in here, caught by the CI. So hold off on merging this.

I'll get that fixed and make sure the tests pass.

@github-actions github-actions bot added the Tests label Dec 25, 2025
ashiklom added a commit to ashiklom/pecan that referenced this pull request Dec 25, 2025
...without the file or database logic, but with some of the
meta-analysis conveniences like pre-processing data, checking
priors/posteriors, and calculating summary statistics.

Takes inputs as lists; returns outputs as lists. Keeps file IO to a
minimum (except as performed by functions this calls).

See discussion in PecanProject#3718.
It's only ever used in `PEcAn.MA::jagify`. Moving it here is a step
towards making `PEcAn.DB` at most a "Suggests" of `PEcAn.MA`.
@ashiklom ashiklom force-pushed the feature/standalone-meta-analysis branch from 5053f3b to 4316360 Compare December 25, 2025 19:07
We should really use `saveRDS` / `readRDS`!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants