Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STICS' write.config using vectors of parameters to overwrite #3395

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

qdbell
Copy link
Contributor

@qdbell qdbell commented Nov 14, 2024

Description

Modified the usage of SticsOnR:set_param_xml() to utilise the vector functionality where many parameters can be passed to write them at once. This entailed removing the individual parameter writing calls and adding a conversion function pecan2stics() that takes pecan parameter names and converts them to the corresponding stics parameter names, along with any necessary unit conversions.

Motivation and Context

This change should speed up the use of PEcAn.STICS as there were many individual set_param_xml calls so it was slow to write configs.

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.

@@ -22,6 +22,7 @@ For more information about this file see also [Keep a Changelog](http://keepacha
* Modules `PEcAn.allometry`, `PEcAn.assim.batch`, `PEcAn.data.mining`, `PEcAn.emulator`, `PEcAn.MA`, `PEcAn.photosynthesis`, `PEcAn.priors`, and `PEcAn.RTM`.
- Renamed master branch to main
- `PEcAn.all::pecan_version()` now reports commit hashes as well as version numbers for each installed package.
- `write.conmfig.STICS()` now modifies parameters with vectors rather than individually.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- `write.conmfig.STICS()` now modifies parameters with vectors rather than individually.
- `write.config.STICS()` now modifies parameters with vectors rather than individually.

Added which STICS file the parameter is found in to the pecan2stics lookup table.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants