8000 Rewrite the growers page as a task path with a worked tomato example (#80) by rafatahmed · Pull Request #88 · rafatahmed/Flahax · GitHub
[go: up one dir, main page]

Skip to content

Rewrite the growers page as a task path with a worked tomato example (#80) - #88

Merged
rafatahmed merged 2 commits into
mainfrom
docs/grower-path
Oct 22, 2026
Merged

rafatahmed merged 2 commits into
mainfrom
docs/grower-path

Conversation

@rafatahmed
Copy link
Copy Markdown
Owner

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.md now walks from a water analysis to a batch sheet:

  1. Enter the water analysis. A JSON template, element mg/L with conversion factors (NO3, NH4, SO4, PO4, alkalinity as CaCO3), measured zeros versus not measured, detection limits, and blending with RO water.
  2. Choose the crop formula. --list-formulas, --crop, or your own --targets.
  3. Run the command. Acids from your certificate, the packaged bases, --limit (and the fact that a maximum also allows that ion up to the limit), volume, pH and ratio.
  4. Read the batch sheet. The status box, tanks and the tank A rule, pH, limits, review reasons, and measuring after mixing.

Then three more sections:

  • Worked example: tomato on the station 104 well (Shomar et al. 2024). The blend share is worked out from the limits: Cl 106.35 ÷ 1280.4 = 8.3 %, so 8 %. The page shows the full sheet table, why the plan needs review, why 9 % is blocked, and the RO-only case (47 mL nitric; blocked without an acid).
  • After mixing: what to measure.
  • When to call an agronomist.

The previous reference tables (stages, EC, catalogue terms) stay at the end, with the stage table updated.

tests/test_growers_page.py reruns the worked example through flahax 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.
  • Review reasons. Formulation and pH stages in review used to show an empty reason. They now say why: incidental nutrients without a declared maximum, or the chosen reagent's review findings and any missed targets.
  • Docs. --water-share is added to the options table in grower-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=1 unittest: 429 tests OK
  • verify_distribution: PASS
  • sphinx -W: clean
  • API reference --check: ok
  • No CRLF
  • Built page viewed in the browser (nested tables render)

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.
@read-the-docs-community
Copy link
Copy Markdown

Documentation build overview

📚 Flahax | 🛠️ Build #35326910 | 📁 Comparing abe753f against latest (76d1044)

  🔍 Preview build  

3 files changed
± changelog.html
± growers.html
± guide/grower-outputs.html

@rafatahmed
rafatahmed merged commit 7535cd7 into main Oct 22, 2026
6 checks pass 8000 ed
@rafatahmed
rafatahmed deleted the docs/grower-path branch October 22, 2026 13:55
@rafatahmed rafatahmed self-assigned this Oct 23, 2026
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Growers page has no task path from water analysis and crop to a batch sheet

1 participant

0