8000 fix: mix stop messages and leftovers, and irrigation EC comparison and input checks by rafatahmed · Pull Request #496 · rafatahmed/Flahax · GitHub
[go: up one dir, main page]

Skip to content

fix: mix stop messages and leftovers, and irrigation EC comparison and input checks - #496

Merged
rafatahmed merged 1 commit into
mainfrom
fix/tui-ec-findings-490
Dec 4, 2026
Merged

rafatahmed merged 1 commit into
mainfrom
fix/tui-ec-findings-490

Conversation

@rafatahmed
Copy link
Copy Markdown
Owner

Summary

Fixes the six findings of the flahax mix and irrigation EC audit (#437).

Closes #490
Closes #491
Closes #492
Closes #493
Closes #494
Closes #495

 Store.save, new name
   link the temporary file into place
+  remove the temporary file                                    (#490)

 flahax mix, stopped during the calculation
-  "Stopped; nothing saved."          after answers were saved
+  "Stopped."                         after answers were saved  (#491)
+  a reagent review prints "Saved the answers as ..."
   saved session, no review: "Stopped; nothing saved."

 flahax mix --plain, before calculating
+  "Calculating the recipe, pH and tanks"                       (#495)

 compare_measured_ec
-  anything but 'estimated' refused
+  'range': within_range True/False, ends inclusive;
+           predicted value and both differences None (no midpoint)
   'estimated': unchanged; 'not_supported': refused             (#492)

Irrigation EC input checks (#493), each now a named DeliveryError:

Input Before After
audit_inputs, reagent_additions_molal not a mapping traceback; an empty list passed invalid_audit_inputs, invalid_value
phases=[[...]] traceback invalid_phase_policy
phases=[1] unknown_phase invalid_phase_policy
compare_measured_ec(None, ...) traceback invalid_value
non-finite residual charge with a supplied pH ignored invalid_value
ionic_molal_conductivity result negative or not finite returned invalid_value

#494 adds tests only: the sign of reagent additions and the refusals for supplied pH, phases and doses.

Evidence

Remaining limit

  • Temperature has no stated fit range for ionic_molal_conductivity, so none is invented: a positive finite result at an extreme temperature is still returned.
  • .tmp copies already left in a store are not removed; they are harmless.
  • Ctrl+C between two item saves can still leave some items saved under the "nothing saved" line.

Checked against earlier work

Merge Danger

Door: two-way

Blast Radius: library-and-mix

  • Callers of compare_measured_ec that relied on a range being refused now get a result with difference_ms_cm of None.
  • ionic_molal_conductivity now refuses some strengths it used to answer with a negative number (for example nitrate at 6 mol/kg).
  • Scripts that read flahax mix --plain output see one more line, and a second one after --review-reagents.

…d input checks

Closes #490
Closes #491
Closes #492
Closes #493
Closes #494
Closes #495
@rafatahmed rafatahmed added bug Something isn't working enhancement New feature or request labels Dec 3, 2026
@rafatahmed rafatahmed self-assigned this Dec 3, 2026
@read-the-docs-community
Copy link
Copy Markdown

📖 3 files modified


Preview · build overview · Flahax · built Dec. 3, 2026, 8:07 p.m. UTC

@codecov
codecov Bot commented Dec 3, 2026
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (f4732d2) to head (7566f6f).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #496   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          155       155           
  Lines        18380     18403   +23     
  Branches      3714      3719    +5     
=========================================
+ Hits         18380     18403   +23     
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.

@rafatahmed
rafatahmed marked this pull request as ready for review December 4, 2026 09:08
@rafatahmed
rafatahmed merged commit 4b3af88 into main Dec 4, 2026
28 checks passed
@rafatahmed
rafatahmed deleted the fix/tui-ec-findings-490 branch December 4, 2026 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
0