Skip to content

Wire GUI equivalence stability controls - #37

Merged
sergioald merged 1 commit into
mainfrom
gui-stop-equivalence-cleanup
Jul 22, 2026
Merged

sergioald merged 1 commit into
mainfrom
gui-stop-equivalence-cleanup

Conversation

@sergioald

Copy link
Copy Markdown
Owner

Summary

Wires the equivalence-style sinuosity stability controls through the GUI and configuration layer.

Changed

  • ldsfl/gui_utils.py

    • adds GUI run-control fields for the equivalence stability diagnostic;
    • includes equivalence settings in config round-tripping and preview output;
    • ignores unknown future run-control fields when loading saved configs;
    • validates equivalence diagnostic settings before a run.
  • gui_ldsfl.py

    • exposes equivalence diagnostic controls in the advanced GUI run settings;
    • forwards those settings from the GUI to the solver;
    • uses the configured equivalence settings when refreshing the live sinuosity panel;
    • safely defaults missing GUI variables in lightweight/headless tests and older config states.
  • ldsfl/main.py

    • adds a guard against solver runs with no enabled stop criteria;
    • forwards the selected equivalence method into the combined sinuosity stability diagnostic.
  • run_ldsfl.py

    • exposes the equivalence diagnostic method through the CLI.
  • tests/test_gui_equivalence_controls.py

    • checks config round-tripping for equivalence settings;
    • checks preview output;
    • checks invalid equivalence settings are rejected;
    • checks the no-enabled-stop-criteria guard;
    • checks that the combined diagnostic forwards the selected equivalence method.

Why

The GUI already exposed the basic sinuosity stability stop switch, but the equivalence-style diagnostic parameters were still effectively hard-coded in the GUI/live-panel path.

After PR #36, the equivalence diagnostic has a selectable statistical method, with increment as the safer default for unit-root-like histories and hac retained for explicit comparison. The GUI should therefore preserve, validate, display, and forward the same controls as the solver/CLI path.

This PR keeps the GUI, saved config files, preview output, CLI options, and solver diagnostics consistent.

Validation

python -m py_compile ldsfl/gui_utils.py ldsfl/main.py run_ldsfl.py gui_ldsfl.py tests/test_gui_equivalence_controls.py
python -m pytest tests/test_gui_equivalence_controls.py tests/test_gui_sinuosity_metrics.py
python -m pytest
python -m run_ldsfl --base-dir . --cases 1 --max-steps 100 --no-plots

@sergioald
sergioald merged commit 0f1b140 into main Jul 22, 2026
3 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ec24bad6bb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread gui_ldsfl.py
'show_completion_popup': bool(self.show_completion_popup_var.get()),
'sinuo_window': self.sinuo_window_var.get(),
'sinuo_rel_tol': self.sinuo_rel_tol_var.get(),
'sinuo_equiv_transient_step': self._safe_tk_string('sinuo_equiv_transient_step_var', '40000'),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve blank transient step when saving GUI configs

When a user leaves the new “Equiv. transient step” field blank to request all-history analysis, _build_config() correctly turns it into None, but this gui_state entry rewrites the blank value to the default string "40000". On load, the GUI applies config.run and then overwrites the field from gui_state, so a saved all-history configuration silently comes back as post-40000-only and future runs use the wrong diagnostic window. Preserve the raw empty string here or omit the GUI override when the field is blank.

Useful? React with 👍 / 👎.

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