Repository navigation
refactor: one HCO3 molar mass, shared between mix_water and water_input - #331
Merged
Merged
Conversation
…ab-water prompts (#323) water_input.HCO3_MOLAR_MASS is the only definition of 61.0168; mix_water imports it and takes the N, S and P masses from MOLAR_MASS (the values are identical). A new test checks that the prompts and the water reader agree on the water keys and masses.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #331 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 148 148
Lines 17464 17466 +2
Branches 3539 3539
=========================================
+ Hits 17464 17466 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
rafatahmed
marked this pull request as ready for review
November 26, 2026 15:51
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 #323.
water_input.HCO3_MOLAR_MASSis the only definition of61.0168.mix_waterimports it, andwater_input.WATER_KEYS['HCO3']uses it, so the lab-water prompts and the water reader can no longer disagree.mix_water.IONStakes the N, S and P masses fromMOLAR_MASSinstead of repeating14.0067,32.06and30.973762. The values are identical, so no result changes and there is no data difference to decide.tests/test_water_constants.py: the HCO3 mass has one definition (checked by identity), every water key the prompts can produce is one the reader accepts, and both use the same mass for each water key. The first test fails onmain's source and passes here.IONSandWATER_KEYSstay separate: they are different mappings (lab name to water key, and water key to equilibrium species), so merging them would not remove duplication.Verification: the nitrogen snapshot (48 files) and the batch and mix snapshot (31 files) from
mainare identical (64-hex hashes masked). Every runnable test module passes;test_grower_outputs,test_mix_cliandtest_grower_journeywere run test by test.test_file_headersfails the same 434 cases asmainon Windows. Not run locally: the slow ratio modules and the pre-push script (over 5 minutes). No chemistry changed, so the PHREEQC fixture is not re-captured. No changelog entry: nothing a user sees changes.