Skip to content

doc: Document .RData handoff points in core workflow functions#3885

Open
S1DDHEY wants to merge 7 commits intoPecanProject:developfrom
S1DDHEY:docs/Rdata-handoff-points
Open

doc: Document .RData handoff points in core workflow functions#3885
S1DDHEY wants to merge 7 commits intoPecanProject:developfrom
S1DDHEY:docs/Rdata-handoff-points

Conversation

@S1DDHEY
Copy link
Copy Markdown
Contributor

@S1DDHEY S1DDHEY commented Mar 19, 2026

Description

This draft PR adds documentation for .RData handoff points in core PEcAn workflow functions. It focuses on improving @returnand @details sections to clarify what objects are written to disk and how they are used by downstream steps.

This work is part 1 of my pre-GSoC prep for the modularity project.

Motivation and Context

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.
  • All new and existing tests passed.

@S1DDHEY S1DDHEY marked this pull request as ready for review March 20, 2026 02:49
@S1DDHEY
Copy link
Copy Markdown
Contributor Author

S1DDHEY commented Mar 21, 2026

The current CI check fails because of multiple .Rd files being out of sync, not sure why there are so many of them as I have only made changes in very few files.

@infotroph
Copy link
Copy Markdown
Member

@S1DDHEY Looks like declaring markdown=TRUE for the whole DB package made Roxygen change something in ~every Rd file.

Adopting Markdown across all our Roxygen docs is a worthy but low-priority goal, so if you're up for reviewing all the changes and confirming the changes are desirable / editing as needed, go for it.

If you'd rather not take that on in this PR, you can take markdown = TRUE out of DESCRIPTION and instead opt in the pages you edited by including #' @md somewhere in each Roxygen block that you want interpreted as Markdown.

@S1DDHEY
Copy link
Copy Markdown
Contributor Author

S1DDHEY commented Mar 23, 2026

@infotroph Thank you for the clarification, for this PR I'd just revert the DESCRIPTION file changes and will proceed by adding the @md tag for all the changes I did.

@S1DDHEY S1DDHEY force-pushed the docs/Rdata-handoff-points branch 2 times, most recently from 7838ba0 to ad9e897 Compare March 23, 2026 19:02
@S1DDHEY S1DDHEY changed the title [WIP] doc: Document .RData handoff points in core workflow functions doc: Document .RData handoff points in core workflow functions Mar 23, 2026
@S1DDHEY
Copy link
Copy Markdown
Contributor Author

S1DDHEY commented Apr 3, 2026

@mdietze let me know if any changes are needed for this one, I'll add the .Rd files accordingly.

##' @details
##' `pft` should be a list containing at least `name` and `outdir`, and
##' optionally `posteriorid` and `constants`.
##' **BEWARE:** All existing files in `pft$outdir` will be deleted on entry.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than giving a warning about this, which I don't think represents the desired behavior, why don't we just fix it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done, removed this part

## Remove old files. Clean up.
old.files <- list.files(path = pft$outdir, full.names = TRUE, include.dirs = FALSE)
file.remove(old.files)

##' @return The `pft` input list, updated with `pft$posteriorid` set to the
##' ID of the (possibly new) posterior record in BETYdb. Note: the function's
##' primary outputs (`trait.data`, `prior.distns`) are currently communicated
##' only through files saved in `pft$outdir`, not through the return value.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this is true. Doesn't the posterior id point you to the right folder if you query BETY?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The posteriorid in the return value does serve as an indirect path to the output files via BETY's dbfiles table (e.g.

files <- dbfile.check(type = "Posterior", container.id = pft$posteriorid, con = dbcon,
return.all = TRUE)
is used to locate exactly these files). Updated the @return

@S1DDHEY S1DDHEY force-pushed the docs/Rdata-handoff-points branch from d41218b to 2f3af16 Compare April 4, 2026 14:14
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