Repository navigation
feat: bound phosphate beyond its fit at its limiting conductivity, narrowing the EC range - #400
Merged
Merged
Conversation
…rrowing the EC range (#392) H2PO4- and HPO4-2 beyond the ionic strength of their fit are bounded at their limiting conductivity (36 and 57 per charge) instead of 80, which cuts every packaged formula's EC range by 41 to 46 %. The species without a coefficient keep the 80 bound; the developer page states why.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #400 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 152 152
Lines 18111 18112 +1
Branches 3657 3657
=========================================
+ Hits 18111 18112 +1
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:
|
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.
NOT READY until CI is green.
Closes #392
The issue named the calcium phosphate and EDTA complexes as the species that set the width of the EC range. Measured on the 13 packaged formulas (reverse-osmosis water, 10,000 L, 1:100, pH 5.8), the width came mostly from phosphate: H2PO4- and HPO4-2 have a fitted coefficient, but every recipe's ionic strength (0.0155 to 0.0349 mol/kg) is above the fit's limit (0.0140), so they were bounded at 80 per charge. They set 77 to 87 % of the width.
Changes:
src/flahax/irrigation_ec.py: H2PO4- and HPO4-2 beyond their fit are bounded at their limiting conductivity per charge (36 and 57, CRC Handbook, "Ionic Conductivity and Diffusion at Infinite Dilution") instead of 80. An ion conducts no more than its limiting value at finite ionic strength. The species without a coefficient keep 80.docs/site/developer/conductivity.md: states what sets the width and why the EDTA complexes and ion pairs stay bounded (no measured conductivity in any source the model uses; they add 0.02 to 0.08 mS/cm).tests/test_sonneveld_appendix_i.pyare updated to the new computed values; each moved by 0.051 to 0.052 mS/cm, the same phosphate effect, and the lower ends are unchanged.Verified on this branch:
test_phosphate_beyond_its_fit_is_bounded_at_its_limiting_conductivityfailed before the change and passes after.Not changed: the low end still counts no phosphate, so a measured EC is expected nearer the high end. Narrowing further needs measured phosphate conductivity above ionic strength 0.014 (#41). Not yet verified: the full CI gate.