Skip to content

feat: phase 1 shared layer roles and derived-data records - #132

Open
lachlangrose wants to merge 3 commits into
mainfrom
feat/shared-layer-roles
Open

lachlangrose wants to merge 3 commits into
mainfrom
feat/shared-layer-roles

Conversation

@lachlangrose

Copy link
Copy Markdown
Member

Summary

Phase 1 of the usability plan. This PR is stacked on #131 (base: fix/phase-0-quick-fixes).

  • Shared layer roles (main/layer_roles.py): geology, geology_unit_field, fault_traces, structure, basal_contacts, dem, and a contacts source setting ("Calculate from geology polygons" or "Use a contacts layer"). They send a change event and are saved with the application state. Old state files load with default values.
  • The Load Data widgets write the roles through the data manager. The Stratigraphic Column geology picker writes and follows the geology role.
  • The Basal Contacts, Thickness, Sorter, Sampler and Paint Order dialogs show the roles as default layers. The user can still change a layer in a dialog for one run.
  • Basal Contacts sets its new layer as the basal_contacts role and as the model contacts (only with the "Calculate from geology polygons" source).
  • Derived-data record (main/derived_data.py): a hash of the inputs of the basal contacts, calculated thickness and strat_order field. A reorder marks them out of date. A colour change does not. A reorder and its undo leave them current.
  • The Stratigraphic Column tab shows the out-of-date results with an Update button.
  • Thickness source: each unit thickness is "typed" or "calculated". A calculated thickness does not replace a typed one.
  • Docs: docs/usage/interface.md.

Notes

  • The model build does not use the new records yet. That is phase 4.
  • Update on basal contacts adds a new "Basal contacts" layer each run, like the dialog did before.

Test plan

  • pytest tests in QGIS 3.42 (232 passed): unit tests for role storage, save/load, change event, input hash and thickness source
  • Check in QGIS: select the geology layer one time and open each dialog; change the column order and see the Update message; move a unit back and see it disappear

🤖 Generated with Claude Code

@lachlangrose
lachlangrose added this pull request to stack #139 October 7, 2026 14:06
Base automatically changed from fix/phase-0-quick-fixes to main October 30, 2026 07:16
Add shared layer roles (geology, unit field, fault traces, structure, basal
contacts, DEM) and a contacts source setting. The map2loop tools show the
roles as their default layers.

Record a hash of the inputs of the basal contacts, the calculated thickness
and the strat_order field. Show the out-of-date results in the stratigraphic
column tab with an Update button. Record if a unit thickness was typed or
calculated, and do not replace a typed thickness.
- The Basal Contacts and Thickness tools record the inputs that the status
  check reads (the layer roles and the saved tool settings). A layer that the
  user selects for one run no longer makes the result out of date. An empty
  field is the same as no field.
- thickness_inputs contains only the settings that the calculator type uses.
  The calculated contacts do not depend on the faults or the unit lists of the
  Basal Contacts tool.
- The thickness is not an input of the styled fields.
- Update on the styled fields makes the graduated classes again when the layer
  is styled by strat_order, with the recorded colour ramp.
- With "duplicate layer", the paint tool records the <name>_strat copy.
- The Thickness tool records a run for all result types.
@lachlangrose
lachlangrose force-pushed the feat/shared-layer-roles branch from 2258721 to abb6e57 Compare October 30, 2026 07:41
lachlangrose added a commit that referenced this pull request Oct 30, 2026

This branch has not been deployed

No deployments
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