Repository navigation
A water report without chloride closes on its alkalinity instead of blocking (#100) - #104
Merged
Merged
Conversation
…; explain the balancing to growers (#100)
rafatahmed
added a commit
that referenced
this pull request
Nov 7, 2026
A water report without chloride closes on its alkalinity instead of blocking (#100)
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.
Owner decision 2026-10-23 on #100, replacing the 'ask your lab' messages merged in #101.
Why balancing exists
Every lab report is slightly out of charge balance (each value has a measurement error). To calculate the pH of the mix, and so the acid, FlahaX closes that small gap at the measured pH. Until now it could only adjust chloride, so a clean report with no chloride was blocked.
Change
balance_water_analysis: when the default balance ionCl-is not measured, zero or below detection and the analysis has carbonate, the gap is closed on the carbonate (secant on total inorganic carbon at the measured pH):reconciliation='closed_on_alkalinity',balance_ion='CO3-2'. Chloride stays as reported. A namedNa+is never switched. Reports beyond the 5 % screen are still refused.flahax mixno longer prints the chloride note at entry.Tests
New
NoChlorideTests(not measured and measured zero both close on alkalinity, charge closes, chloride stays zero, analysis kept; chloride present still closes on chloride). The #84 test for a measured-zero chloride now checks that chloride is untouched and the carbonate closes it.flahax mixtest: a balanced report without chloride gives a ready sheet that never mentions chloride, and the full report carries the note.514 tests with live PHREEQC required; strict Sphinx build;
tools/verify_distribution.pyPASS.