Repository navigation
Rewrite the growers page as a task path with a worked tomato example (#80) - #88
Merged
Merged
Conversation
recommend() raised 'NNLS did not reach optimality' when the source water alone exceeded one declared maximum while another was binding, for example 9% of the station 104 well with Na and Cl maxima of 3 mmol/L. A ceiling the water already reaches cannot be met, so its Lagrange search (#68) never closed its bracket and grew the shift on every step until the right-hand side was about 2^60 times the limit; with a second active ceiling NNLS then failed. Any product carrying that ion only adds to the violation, so the fit now leaves those products out directly, the infinite-multiplier limit the search was approaching. The excess is still reported in limitViolations. Over 312 formula x water share x ceiling cases the recipes are identical wherever the old search succeeded; the failing cases equal the fit without chloride products.
…80) The page explained how to read results but not how to produce one. It now walks from a water analysis to a batch sheet in four steps: enter the analysis (element mg/L with conversion factors, measured zeros, detection limits), choose the formula, run flahax batch, read the sheet. Then a worked tomato example on the station 104 well blended with RO water: 8% passes the 3 mmol/L Na and Cl limits, 9% is blocked on its measured chloride; what to measure after mixing; and when to call an agronomist. The reference tables stay at the end. tests/test_growers_page.py reruns the example and checks the page's table and quoted numbers. flahax batch --water-share PERCENT blends the analysed water with ion-free water: nutrients and limits scale the laboratory values and the chemistry dilutes the measured-pH record (#84). Formulation and pH stages that need review now give the reason instead of an empty message.
rafatahmed
added a commit
that referenced
this pull request
Nov 7, 2026
Rewrite the growers page as a task path with a worked tomato example (#80)
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 #80. Builds on #87; merge that first. Until then this PR's diff also shows #87's engine commit.
The page
docs/site/growers.mdnow walks from a water analysis to a batch sheet:--list-formulas,--crop, or your own--targets.--limit(and the fact that a maximum also allows that ion up to the limit), volume, pH and ratio.Then three more sections:
The previous reference tables (stages, EC, catalogue terms) stay at the end, with the stage table updated.
tests/test_growers_page.pyreruns the worked example throughflahax batch. It checks the page's water file, its whole sheet table and every quoted number, so the page cannot drift from the package.Small package changes the walkthrough needed
flahax batch --water-share PERCENT. The analysed water makes up that share of the batch water and ion-free water the rest. Without it, a grower with this well could only get a blocked sheet. Nutrients and limits scale the lab values; the chemistry dilutes the measured-pH record from Concentration limits use charge-balanced water instead of the laboratory analysis #84. If the analysis cannot be closed, the chemistry is left out with the reason and nutrient accounting continues.--water-shareis added to the options table ingrower-outputs.md.Found while writing it
The 9 % run raised an NNLS error instead of reporting the chloride exceedance: issue #86, fixed in #87.
Validation
FLAHAX_REQUIRE_PHREEQC=1unittest: 429 tests OKverify_distribution: PASSsphinx -W: clean--check: ok