Name the ice vapor-pressure coefficients and reuse Vapor_pressure - #40
Merged
Ickaser merged 1 commit intoAug 6, 2026
Merged
Conversation
The two coefficients of the ice vapor-pressure correlation appeared as bare literals in three places: Vapor_pressure, the inverted form in Tbot_max_eq_cap, and an inline re-derivation in Eq_Constraints. A correction to either coefficient had to be found in all three, and the inverted form is easy to miss because the numbers appear rearranged. Name them as module constants with their units, use them in both the forward and inverted forms, and have Eq_Constraints call Vapor_pressure instead of re-deriving it. The C1 rewrite is bitwise identical over the primary drying range (max abs diff 0.0 across -45 to 5 degC). Refs #12. Full test suite: 144 passed, 1 skipped.
Member
|
I don't love the verbosity of the names but they are clear enough; there are enough other style problems in the repo that I think this is acceptable as is. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #39. Refs #12.
The two coefficients of the ice vapor-pressure correlation appeared as bare literals in three places in
lyopronto/functions.py—Vapor_pressure, the inverted form inTbot_max_eq_cap, and an inline re-derivation inEq_Constraints. This names them once, with their units, and hasEq_ConstraintscallVapor_pressurerather than duplicating the formula.No behavior change. The
C1rewrite is bitwise identical across the primary drying range:The numeric values are untouched — this is a naming and de-duplication change only, so the correlation itself is unchanged and no fit or reference value moves.
Tests
pytest tests/on this branch: 144 passed, 1 skipped (608 s), coverage 99%.Branched from
4fb63df. Independent of #38, which touches a different module. Found while syncing SECQUOIA/LyoPRONTO, which carries the same change.