8000 fix: correct Pepper sulfur and iron and Tomato Stage.3 calcium to their sources by rafatahmed · Pull Request #405 · rafatahmed/Flahax · GitHub
[go: up one dir, main page]

Skip to content

fix: correct Pepper sulfur and iron and Tomato Stage.3 calcium to their sources - #405

Merged
rafatahmed merged 1 commit into
mainfrom
fix/formula-values-401-403
Nov 30, 2026
Merged

rafatahmed merged 1 commit into
mainfrom
fix/formula-values-401-403

Conversation

@rafatahmed
@rafatahmed rafatahmed commented Nov 30, 2026 •
Copy link
Copy Markdown
Owner

NOT READY until CI is green.

Closes #401
Closes #403

Corrects two stored formula targets to their sources:

Formula Value Was Now Source
Tomato Stage.3 Ca 400 197 Resh (2022), Table 3.7, University of British Columbia 1971 formula C, book p.57
Pepper (Howard Resh) S 360 120.14990630855715 archived Resh pepper table: sulfate (SO4) 360, converted as 360 x MOLAR_MASS['S'] / 96.06, the conversion the water inputs use (mix_water.py)
Pepper (Howard Resh) Fe 5 2.25 the original 1.5 to 3.0, stored as its midpoint (as the lettuce formulas store range midpoints)

Independent check: both formulas were far from ion balance and are now balanced, as their sources are. Pepper goes from -39.5 % to +1.0 %; Stage.3 from +29.4 % to -0.7 %. With the corrected targets, Pepper meets every target in a real flahax batch run (status ready) and Stage.3 misses at most 0.77 %.

Also changed:

  • Four test modules and the shipped user-guide example used the wrong values as examples and now test the real behaviour: test_guards (the "sulfur deficit" came from S 360), test_grower_journey_reports (two cases use Lettuce 2 for the tiny-miss scenario and Pepper as a fully met formula), test_target_ion_balance (Lettuce General is the unbalanced example, cross-checked with the codebase's atomic masses), and test_packaged_catalogue (new ion-balance and conversion tests, written first and watched failing), plus the user-guide example (Pepper is balanced).
  • Docs: the formula page rows and source tables, the HydroBuddy note (11 of 13 profiles still match it; these two now differ), the migration table and the changelog (Fixed).

Verified on this branch:

  • All 244 test modules were run in batches, one module at a time. Every module passes. Modules that touch the formulas, the user guide or the docs were rerun after the last data edit: 53 modules (listed in the test-run records), all pass.
  • Lint passes.

Notes:

  • Saved recipes fitted to Pepper or Tomato Stage.3 change when recalculated (stated in the migration guide).
  • The PHREEQC reference fixture was not re-captured: no conversion, speciation, saturation or EC code changed, only two formula targets. The integrity tests pass.
  • test_mix_cli (432 s here), test_ratio_solver_stress (583 s) and test_grower_journey_catalogue_even (327 s) each exceed five minutes alone; splitting them is separate work.

Not yet verified: the CI coverage and Python 3.11 gates.

…ir sources (#403, #401)

Pepper (Howard Resh) stores the original sulfate 360 as sulfur (360 x 32.06 / 96.06, the conversion the water inputs use) and iron 2.25, the midpoint of the original 1.5 to 3.0. Tomato Stage.3 stores calcium 197, the value in Resh (2022), Table 3.7. Both formulas are now ion balanced, as their sources are.
@rafatahmed rafatahmed added the bug Something isn't working 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 #36271973 | 📁 Comparing cf2795e against latest (af2a279)

  🔍 Preview build  

4 files changed
± changelog.html
± agronomist/formula-and-products.html
± reference/manual.html
± start/migration.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 (af2a279) to head (cf2795e).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #405   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          152       152           
  Lines        18112     18112           
  Branches      3657      3657           
=========================================
  Hits         18112     18112           
Flag Coverage Δ
unittests 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 17:41
@rafatahmed
rafatahmed merged commit fd722c9 into main Nov 30, 2026
29 checks passed
@rafatahmed
rafatahmed deleted the fix/formula-values-401-403 branch November 30, 2026 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

1 participant

0