8000 refactor: move run_batch and water handling out of batch_cli by rafatahmed · Pull Request #324 · rafatahmed/Flahax · GitHub
[go: up one dir, main page]

Skip to content

refactor: move run_batch and water handling out of batch_cli - #324

Merged
rafatahmed merged 2 commits into
mainfrom
refactor/batch-request
Nov 26, 2026
Merged

rafatahmed merged 2 commits into
mainfrom
refactor/batch-request

Conversation

@rafatahmed
Copy link
Copy Markdown
Owner

Closes #322.

run_batch and BatchOptions move from batch_cli.py to a new batch_request.py, with the acid, formula, joint-configuration, remedy and range handling. The water reader (read_water, blend, water_basis) moves to water_input.py, and read_json to inputs.py (both need it, so it cannot live in either new module). batch_cli.py keeps argument parsing, render, render_saved_result, build, main and the exit codes.

  • A pure move: no flag, message, exit code or output changes. Nothing is newly exported from flahax; the API reference is unchanged.
  • mix_cli, mix_tui, mix_store and mix_sonneveld import from the new modules; mix_cli keeps limit_entry and render from batch_cli. About 25 tests re-point their imports and patches to the module that now owns each name; no assertion changes.
  • The water code in batch_cli and mix_water.py is two layers (reading a water file versus prompt-time lab units), not duplicated logic. The only duplication is the HCO3 constant and the name mapping, tracked in Share the HCO3 molar mass and the N, S and P masses between mix_water and water_input #323; the S, P and N constants equal MOLAR_MASS, so there is no data difference.

Verification: six flahax batch scenarios (one blocked) and two flahax mix saved-session replays were captured on main and compared after the move: 31 files identical once 64-hex hashes are masked. Every runnable test module passes; test_grower_journey was run test by test. test_file_headers fails the same 434 cases as main on Windows. Not run locally: the slow ratio modules (they import nothing changed) and the pre-push script (over 5 minutes). No chemistry changed, so the PHREEQC fixture is not re-captured.

…f batch_cli

batch_request holds BatchOptions and run_batch with the acid, joint, remedy and
range handling; water_input holds read_water, blend and water_basis; read_json
moves to inputs. batch_cli keeps argument parsing, output and exit codes. A pure
move: no flag, message, exit code or output changes.
@rafatahmed rafatahmed added the enhancement New feature or request label Nov 26, 2026
@rafatahmed rafatahmed self-assigned this Nov 26, 2026
@read-the-docs-community
Copy link
Copy Markdown

Documentation build overview

📚 Flahax | 🛠️ Build #36178904 | 📁 Comparing 4436b4a against latest (c65b8d9)

  🔍 Preview build  

3 files changed
± changelog.html
± agronomist/reading-results.html
± developer/index.html

@rafatahmed
rafatahmed marked this pull request as ready for review November 26, 2026 04:13
@rafatahmed
rafatahmed merged commit b148375 into main Nov 26, 2026
27 checks passed
@rafatahmed
rafatahmed deleted the refactor/batch-request branch November 26, 2026 04:13
@codecov
codecov Bot commented Nov 26, 2026
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (c65b8d9) to head (4436b4a).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #324   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          145       147    +2     
  Lines        17441     17459   +18     
  Branches      3539      3539           
=========================================
+ Hits         17441     17459   +18     
Flag Coverage Δ
unittests 100.00% <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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move run_batch and the water, acid and range handling out of batch_cli

1 participant

0