Skip to content

Fix/do conversions run input typo#3929

Closed
shreyannandanwar wants to merge 4 commits intoPecanProject:developfrom
shreyannandanwar:fix/do-conversions-run-input-typo
Closed

Fix/do conversions run input typo#3929
shreyannandanwar wants to merge 4 commits intoPecanProject:developfrom
shreyannandanwar:fix/do-conversions-run-input-typo

Conversation

@shreyannandanwar
Copy link
Copy Markdown
Contributor

Fix a consistent copy-paste typo: settings$run$input (singular) → settings$run$inputs (plural) across 4 files.

Evidence

1. Usage count in codebase

  • run$input (singular): fewer occurrences, never assigned anywhere
  • run$inputs (plural): way more if compared within do_conversions.R alone
  • Zero assignments to run$input found across base/, modules/, scripts/

2. Settings schema confirms inputs (plural) is canonical

  • base/settings/R/update.settings.R references <inputs> always plural, never singular
  • base/settings/ contains zero occurrences of a literal <input> tag as a child of <run>
  • This means run$input (singular) has no corresponding schema definition — it would silently return NULL at runtime

3. check.all.settings.R confirms the canonical field name

  • base/settings/R/check.all.settings.R validates the settings object and only references run$inputs (plural) throughout
  • No validation path, no coercion, and no fallback exists for a singular run$input field
  • If run$input were intentional, it would appear in settings validation — it does not

4. Official PEcAn XML documentation uses <inputs> exclusively

  • book_source/03_topical_pages/03_pecan_xml.Rmd documents the <run> block and its children
  • The <inputs> tag (plural) is the only form shown in all examples and explanations in that section
  • Zero mentions of a singular <input> child under <run> anywhere in the XML guide

5. No documentation anywhere defines run$input as intentional

  • Searched .Rd, .Rmd, .qmd, .xml across the entire repo
  • 0 matches for run$input as a documented or intentional field name

Conclusion

The schema, the validator, the XML documentation, and the overwhelming majority of code all agree: the canonical field is run$inputs. The singular run$input usages are inconsistent legacy copy-paste typos that would silently return NULL at runtime, causing inputs to be
misrouted or skipped without any error or warning.

Files changed

  • base/workflow/R/do_conversions.R
  • scripts/workflow.bm.R
  • scripts/workflow.pda.R
  • modules/data.land/R/soil_process.R

Risk

Low — mechanical typo fix, no logic changed.
The field run$input was never assigned anywhere in the codebase, so correcting these references to run$inputs restores intended behavior.

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.

Shreyan added 4 commits March 4, 2026 17:24
settings$run$input (singular) was used on one line each in
do_conversions.R, workflow.bm.R, workflow.pda.R and soil_process.R
while all surrounding code and the settings schema use run$inputs.

No assignment to run$input was found anywhere in the codebase.
Schema in base/settings/ only defines <inputs> (plural).
This was a consistent copy-paste typo, not an intentional field.

Fixes:
- base/workflow/R/do_conversions.R:31
- scripts/workflow.bm.R:103
- scripts/workflow.pda.R:66
- modules/data.land/R/soil_process.R:65-68
Copy link
Copy Markdown
Contributor

@S1DDHEY S1DDHEY left a comment

Choose a reason for hiding this comment

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

@shreyannandanwar The changes in run.meta.analysis.R appear to include unrelated work that doesn’t match the PR description.

I'd suggest cleaning up the branch (e.g., drop unrelated commits or cherry-pick only the relevant ones) and update the PR accordingly.

Copy link
Copy Markdown

@Yeligay8 Yeligay8 left a comment

Choose a reason for hiding this comment

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

In the check (check_modules, 4.4) / check section:
I recommend to open the R file where the function is defined:

meta_analysis_standalone <- function(...) {

Above the function, you should have something like:

#' @param prior_n ...
#' @param prior_cv ...
#' @param tauA ...
#' @param tauB ...
#' @param gamma_tau ...

Update documentation to match function. If these arguments exist in function, ADD missing params:
#' @param prior_n Description here
#' @param prior_cv Description here
#' @param tauA Description here
#' @param tauB Description here

If gamma_tau doesn't exist in function, REMOVE it:

DELETE this line:

#' @param gamma_tau ...

then run this:
devtools::document()

then re-run checks locally
devtools::check()

OR same as CI:

make -j1 check_modules

Copy link
Copy Markdown

@Yeligay8 Yeligay8 left a comment

Choose a reason for hiding this comment

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

In , check (check_base, 4.2) / check section, to fix check error (Error = repo changed during CI and Cause = .Rd not synced with .R):
I recommend to run locally, then commit the changes:

Install if needed

install.packages("roxygen2")

Regenerate documentation

roxygen2::roxygenise()

Then commit the updated files:
git add modules/meta.analysis/man/meta_analysis_standalone.Rd
git commit -m "Update Rd docs to match function arguments"
git push

@infotroph
Copy link
Copy Markdown
Member

infotroph commented Apr 14, 2026

@Yeligay8 Thanks for jumping in here! But in this case the underlying problem here isn't the out-of-sync Roxygen docs, it's the presence of edits from a different PR -- fixing a typo in do_conversions should not touch the meta-analysis code at all, and we can't merge this until that's fixed.

(As a smaller matter I recommend everyone follow the PEcAn developer guide and use make rather than manually manage Roxygen builds, but that's mostly a matter of preference)

@shreyannandanwar please do whatever combination of git operations you prefer (likely one or more of cherry-pick, rebase, or revert) to make this branch contain all the typo fixes from commit ecfa103 (do_conversions, soil_process, workflow.bm, and workflow.pda) but without adding .Rapp.history. Commits c82d851, 3a72d67, and 603fae2 should be removed.

@shreyannandanwar
Copy link
Copy Markdown
Contributor Author

plzzz checkout -> #3932

I apologies for the noise on the previous PR. I accidentally included unrelated commits (c82d851, 3a72d67, 603fae2) and a stray .Rapp.history file that should never have been tracked.

I've cleaned this up by cherry-picking only the intended fix (ecfa103) onto a fresh branch. This PR now contains exactly 1 commit touching exactly 4 files nothing more.

Thank u @infotroph
Thank u @S1DDHEY
Thank u @Yeligay8

@mdietze
Copy link
Copy Markdown
Member

mdietze commented Apr 15, 2026

Closing because superseded by #3932

@mdietze mdietze closed this Apr 15, 2026
@S1DDHEY
Copy link
Copy Markdown
Contributor

S1DDHEY commented Apr 15, 2026

@shreyannandanwar Instead of opening a new PR, you could rewrite the commit history here using git reset --soft HEAD~x (where x is the number of commits to go back). This keeps your changes staged, allowing you to remove or adjust unnecessary changes before recommitting into a cleaner history.

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.

5 participants