8000 feat: bound phosphate beyond its fit at its limiting conductivity, narrowing the EC range by rafatahmed · Pull Request #400 · rafatahmed/Flahax · GitHub
[go: up one dir, main page]

Skip to content

feat: bound phosphate beyond its fit at its limiting conductivity, narrowing the EC range - #400

Merged
rafatahmed merged 1 commit into
mainfrom
feat/ec-uncovered-species
Nov 30, 2026
Merged

rafatahmed merged 1 commit into
mainfrom
feat/ec-uncovered-species

Conversation

@rafatahmed
Copy link
Copy Markdown
Owner

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.
  • Result: every packaged formula's range narrows by 41 to 46 % and is now 2.5 to 6.0 % of the EC (was 4.4 to 10.8 %); packaged cucumber 2.243 to 2.325 mS/cm (was 2.389). The low end is unchanged.
  • 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).
  • Five pinned upper-end EC values in tests/test_sonneveld_appendix_i.py are 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:

  • New test test_phosphate_beyond_its_fit_is_bounded_at_its_limiting_conductivity failed before the change and passes after.
  • 23 EC-related test modules, each run alone, all pass.
  • Docs and public-contract tests pass; lint passes.

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.

…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.
@rafatahmed rafatahmed added the enhancement New feature or request label Nov 30, 2026
@rafatahmed rafatahmed self-assigned this Nov 30, 2026
@read-the-docs-community
Copy link
Copy Markdown

Documentation build overview

📚 Flahax | 🛠️ Build #36263624 | 📁 Comparing bc7a573 against latest (49c1a36)

  🔍 Preview build  

2 files changed
± changelog.html
± developer/conductivity.html

@codecov
codecov Bot commented Nov 30, 2026
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (49c1a36) to head (bc7a573).

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     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@rafatahmed
rafatahmed marked this pull request as ready for review November 30, 2026 12:45
@rafatahmed
rafatahmed merged commit bd1de1a into main Nov 30, 2026
29 checks passed
@rafatahmed
rafatahmed deleted the feat/ec-uncovered-species branch November 30, 2026 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cover or justify the 43 EC species with no conductivity coefficient

1 participant

0