Repository navigation
Add simple and advanced tomato examples with a report and grower batch sheets - #73
Merged
Merged
Conversation
…h sheets tomato_simple: the shipped Howard Resh tomato formula in RO water; recipe, 1000 L batch, nutrient fit, ion balance, identities and an EC estimate, and the note that the unacidified mix (pH 6.9) needs acid. tomato_advanced: a published brackish well (Shomar et al. 2024, station 104) with Dutch open-system tomato targets. Balances the analysis at its measured pH, picks the largest blend within 3 mmol/L Na and Cl (9% well), shows why phosphoric acid is withdrawn as a P source (feed pH 3.8), speciates the mix, evaluates nitric and phosphoric acid (both refused, with reasons) and computes the nitric dose, which also closes the nitrate gap; estimates EC, groups concentrate tanks, sizes injection, and runs three stage formulas as separate batches. tomato_tanks groups concentrates with the Yara compatibility table (04_Fertilizer.pdf p. 65, read with p. 63); products it does not list are marked, never guessed. tomato_report writes an offline HTML report with charts and two printable one-page batch sheets. Both examples join run_all; tests check the claims the report and sheets make.
This was referenced Oct 21, 2026
Closed
Closed
Closed
Owner
Author
rafatahmed
added a commit
that referenced
this pull request
Nov 7, 2026
Add simple and advanced tomato examples with a report and grower batch sheets
rafatahmed
added a commit
that referenced
this pull request
Nov 7, 2026
…79) An installed FlahaX gave growers JSON: the report, the batch sheet and the concentrate-tank grouping existed only as example code (#73). - flahax batch: one formula (packaged, or your targets) and one water (ro, or a measured analysis closed at its pH) to report.html, batch-sheet.html and summary.json, with the coupled pH plan (acids from certificate values, plus the packaged bases). Exit 0 ready/review, 3 blocked, 1 input error. - summarize_batch, render_report, render_batch_sheet: the same from any plan_fertilizer_workflow result. With a selected reagent the sheet weighs the refitted recipe that counts its nutrients; a blocked plan shows the acid-free recipe and the phases that block it. Offline HTML, no script. - group_tanks: the Yara p. 65 compatibility table (read with p. 63) as three composition rules (Ca-phosphate, Ca-sulfate, Mg-phosphate), which reproduce its twelve incompatible pairs exactly. Owner rule: micronutrients and chelates go to tank A with calcium and stay out of phosphate concentrates; tank A is never acidified; pH reagents get their own channel. User compatibilityRule records apply on top. default_compatibility_rules gives plan_stocks the same rules. - Tomato examples use the packaged grouping (micronutrients no longer 'Not in table') and their acid text reflects #78. Stock solubility is still not checked, and the outputs say so.
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.
Adds tomato examples that show what FlahaX can do, from a one-screen simple case to a full analysis-to-batch plan, plus an offline HTML report and printable grower batch sheets.
Run
Simple: Tomato (Howard Resh) in RO water
The example covers products and doses, a 1000 L batch, nutrient fit (every target within 0.04%), the formula's ion balance (0.0%), chemical identity per product, and an experimental EC estimate (2.31 mS/cm). It also reports that the unacidified mix sits at pH 6.90, outside the 5.3–5.8 feed range.
Advanced: a published brackish well
Real, cited data: the Shomar et al. (2024) station 104 well, with De Kreij, Voogt & Baas tomato open-system targets.
04_Fertilizer.pdfp. 65, read with p. 63).Tank grouping from a cited source
examples/tomato_tanks.pyencodes the page 65 table, which I verified visually against the PDF (the hash matches the one already cited in the pepper review).Reports
tomato-report.html. Both examples, with charts (target vs delivered, Na/Cl by blend), tables and the sources.batch-sheet-simple.htmlandbatch-sheet-advanced.html. Printable one-page sheets: the water line; what to weigh per tank, with tick boxes; concentrate g/L at 1:100; the acid step with its warning; and measure-after-mixing lines for EC, pH, operator, date and signature.All three are offline HTML with no scripts and no external resources, printable to PDF. I checked them visually in the browser.
Example acid grades, the site figures and the 1:100 ratio are labelled illustrative. Every computed value comes from
run().Also
run_all.Tests
tests/test_tomato_examples.py(9 tests) checks the claims the report makes: