Skip to content

feat: step-based dock (usability plan, phase 3) - #134

Merged
lachlangrose merged 5 commits into
feat/strat-column-uifrom
feat/step-based-dock
Nov 1, 2026
Merged

lachlangrose merged 5 commits into
feat/strat-column-uifrom
feat/step-based-dock

Conversation

@lachlangrose

Copy link
Copy Markdown
Member

Phase 3 of the usability plan. Stacked on #133: the base is feat/strat-column-ui, so retarget to main after #133 merges.

Changes

  • The modelling dock has five steps: Data, Stratigraphy, Faults, Model, View. A step bar shows a status for each step (check, warning triangle, hollow circle). The footer shows the main message of the current step, with Back and Next.
  • Each step has a check() function (gui/modelling/steps/checks.py, no QGIS import) that returns problems and to-do items.
  • Save, Open, Reset and Settings are in the dock header.
  • The map2loop dialogs open from the steps through map2loop_tools/launchers.py. They are not rewritten.
  • Fault layers and the Fault Topology Calculator are in step 3.
  • The toolbar has three actions (LoopStructural, 3D View, Help). The Plugins menu has a Tools submenu.
  • separate_dock_widgets still works: step 5 has an Open 3D view button.

Notes

  • The dock runs the checks every 750 ms while it is visible, because several widgets hold the only callback in the data manager.
  • Not tested in a running QGIS: the connection stopped on plugin reload. Please run the dock before merge.

Tests

  • 27 new unit tests for the checks (tests/unit/test_step_checks.py); all 97 unit tests pass.

🤖 Generated with Claude Code

Replace the tabs of the modelling dock with five steps (Data,
Stratigraphy, Faults, Model, View). Each step has a check function, and the
step bar and the footer show the result. Move Save, Open, Reset and Settings
to the dock header, put the map2loop dialogs in the steps, and reduce the
toolbar to three actions with a Tools submenu.
- map2loop gives each contact the younger unit, so the oldest unit has no
  basal contacts. A contact on an unconformity goes to the unit above it,
  so the units on each side of an unconformity are still checked.
- Calculate the units of the contacts layer again when the layer is edited.
- Show the out-of-date derived results on step 2 only, not on step 4.
lachlangrose added a commit that referenced this pull request Oct 30, 2026
…tep branch

# Conflicts:
#	loopstructural/gui/modelling/steps/checks.py
lachlangrose added a commit that referenced this pull request Oct 30, 2026
- When the contacts and the thicknesses are calculated together, the
  thickness calculation uses the new contacts, not the out-of-date layer.
- The background thread does not change the data manager. finish() puts
  the contacts into the model on the GUI thread.
- Read the inputs with basal_contacts_inputs() and thickness_inputs()
  without arguments. #134 changed these functions, so the build failed.
- qgsLayerToGeoDataFrame accepts a GeoDataFrame.
- Add unit tests for the order and for the thread rule.
- Make the step titles with dict().
- Rename the unused loop variable.
@lachlangrose
lachlangrose merged commit 4308354 into main Nov 1, 2026
7 checks passed
@lachlangrose
lachlangrose deleted the feat/step-based-dock branch November 1, 2026 06:50
lachlangrose added a commit that referenced this pull request Nov 1, 2026
…135)

* feat: model step with one build button and direct interpolation

Phase 4 of the usability plan.

- One primary button replaces Initialize Model, Solve Model and Update
  Model Data. Its text and action come from the model state. The problems
  of all steps show above the feature list.
- A build calculates out-of-date basal contacts and thicknesses first, on a
  background task with progress. With "Calculate from geology polygons" the
  model reads the extracted contacts directly; the project layer is for
  display only.
- Start choice: build from a geological map, or interpolate surfaces from
  constraints (hides steps 2 and 3). Saved with the state.
- Constraint types: value, interface, gradient/normal, tangent, form line,
  inequality and pairwise inequality, each with a weight and a Z source
  (layer, DEM or constant).
- Detach a generated feature to keep a fixed copy of its data. Rows added
  to a generated feature are now used in the build.
- Preview one feature as isolines on the map.
- Add Fault from a centre, strike, dip and size.

* style: fix the ruff errors in the step bar

- Make the step titles with dict().
- Rename the unused loop variable.

* fix: give the new contacts to the thickness step of a build

- When the contacts and the thicknesses are calculated together, the
  thickness calculation uses the new contacts, not the out-of-date layer.
- The background thread does not change the data manager. finish() puts
  the contacts into the model on the GUI thread.
- Read the inputs with basal_contacts_inputs() and thickness_inputs()
  without arguments. #134 changed these functions, so the build failed.
- qgsLayerToGeoDataFrame accepts a GeoDataFrame.
- Add unit tests for the order and for the thread rule.

* fix: name the fault sizes from the slip, as LoopStructural uses them

LoopStructural puts the major axis along cross(normal, slip) and the
intermediate axis along the slip. The dialog said along strike and down
dip, which is correct only for dip slip. The labels are now "across the
slip" and "along the slip". Add axis_vectors() and tests for the axes.

* fix: added rows of a generated feature

- A row that the user adds to or deletes from a generated feature makes
  the model stale, so that the next action is a rebuild.
- A bad added row is left out, and the build tells the user. Before, one
  bad row removed all the added rows of the feature.
- Inequality and Pairwise Inequality have no weight, because
  LoopStructural ignores it.
- Test the save and load of detached data through JSON.
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