Skip to content

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

Open
lachlangrose wants to merge 3 commits into
fix/phase-0-quick-fixesfrom
feat/shared-layer-roles
Open

lachlangrose wants to merge 3 commits into
fix/phase-0-quick-fixesfrom
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

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.
@lachlangrose
lachlangrose added this pull request to stack #139 October 7, 2026 14:06

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