Skip to content

Reject blank GUI erosion rate - #42

Merged
sergioald merged 1 commit into
mainfrom
reject-blank-erosion-rate
Jul 24, 2026
Merged

sergioald merged 1 commit into
mainfrom
reject-blank-erosion-rate

Conversation

@sergioald

Copy link
Copy Markdown
Owner

Summary

Rejects a blank value in the GUI bank-erodibility / erosion-rate field instead of silently restoring the historical 1.0e-8 default.

Why

PR #41 used _safe_tk_string(..., '1e-8') while building the GUI run configuration. Clearing the required erosion-rate field therefore caused the GUI to continue with 1.0e-8 without warning.

That is unsafe for sensitivity studies because the submitted run can differ from the value the user intended.

Changes

  • adds a required-float GUI parser with a clear error for blank values;
  • uses it for the erosion-rate field;
  • retains the historical default only when creating a new GUI or loading an older configuration that lacks the field;
  • adds a regression test covering blank rejection and valid scientific notation.

Validation

python -m py_compile gui_ldsfl.py tests/test_erosion_rate_control.py
python -m ruff check gui_ldsfl.py tests/test_erosion_rate_control.py
python -m pytest tests/test_erosion_rate_control.py
python -m pytest

@sergioald
sergioald merged commit 8976ed9 into main Jul 24, 2026
3 checks passed
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.

1 participant