Replace manual unit conversions with ud_convert() for consistency across models#3719
Replace manual unit conversions with ud_convert() for consistency across models#3719infotroph merged 59 commits intoPecanProject:developfrom
Conversation
infotroph
left a comment
There was a problem hiding this comment.
Thanks for working on this! Can you describe how you tested these changes? I ask because I see a few issues here that should have produced obvious error messages in a test run. The issues themselves are minor and will be easy to fix, but since unit conversions can be surprisingly tricky it's important to know at review time that someone has actually run the code and looked at its output.
|
hi @infotroph Thanks for the review and for pointing this out.
Thanks for the reminder !! |
Co-authored-by: Chris Black <chris@ckblack.org>
Co-authored-by: Chris Black <chris@ckblack.org>
|
Hi @infotroph |
Co-authored-by: Chris Black <chris@ckblack.org>
Co-authored-by: Chris Black <chris@ckblack.org>
Co-authored-by: Chris Black <chris@ckblack.org>
Co-authored-by: Chris Black <chris@ckblack.org>
Co-authored-by: Chris Black <chris@ckblack.org>
Co-authored-by: Chris Black <chris@ckblack.org>
Co-authored-by: Chris Black <chris@ckblack.org>
|
hey @infotroph sorry for the late response i have exams and college related work. |
Co-authored-by: Chris Black <chris@ckblack.org>
…nce, restore required testthat.R, remove empty file
…sing maintainer feedback
… maintainer feedback
…oblematic Mg/ha/yr conversion
Co-authored-by: Chris Black <chris@ckblack.org>
Co-authored-by: Chris Black <chris@ckblack.org>
Co-authored-by: Chris Black <chris@ckblack.org>
|
@ayushman1210 The hopefully-last step before merging is to debug the remaining |
|
@ayushman1210 I saw the issue, pushed a fix, and will merge as soon as I see tests pass -- apologies for not waiting, but I'm eager to merge this ahead of some other work. Thanks for getting this done! |
Description
This PR standardizes dimensional unit conversions by replacing manual arithmetic with the centralized helper function PEcAn.utils::ud_convert() where appropriate. This reduces maintenance burden, improves readability, and minimizes the risk of unit conversion errors.
The changes focus strictly on dimensional unit conversions (mass, time, energy, area) and intentionally exclude model-specific scaling, biological constants, and timestep-dependent logic, per project guidance.
Summary of Changes
NOT CHANGED
Fixes - #3712