Skip to content

fix(modelling): onlap regions, model.save, intrusions list, map2loop supergroups, fault-unit matrix - #414

Merged
lachlangrose merged 6 commits into
masterfrom
fix/core-model-small-bugs
Nov 26, 2026
Merged

lachlangrose merged 6 commits into
masterfrom
fix/core-model-small-bugs

Conversation

@lachlangrose

Copy link
Copy Markdown
Member

Fixes five small bugs found in a repo audit. Each has a regression test that fails without the fix.

  • add_onlap_unconformity deleted the feature's existing regions (feature.regions = []). An onlap series was then no longer cut by the younger erosional unconformities above it. The line is removed.
  • model.save() crashed with its default arguments. It looped for group in model.stratigraphic_column, which raised KeyError, after it had already written some files. It now loops over get_groups(). The stratigraphic_surfaces flag is no longer overwritten. Data files are named after each feature, so they no longer overwrite each other. get_stratigraphic_surfaces(units=[...]) now returns only the units you ask for.
  • model.intrusions was always empty. It compared an IntEnum with the string "intrusion".
  • Map2LoopProcessor named every supergroup supergroup_0. The counter was reset on every line. Checked against a real map2loop super_groups.csv, which has one supergroup per line.
  • FaultTopology.get_fault_stratigraphic_unit_relationships always returned zeros. The (group, unit) pairs were unpacked in the wrong order.

Review notes, not changed here (all but the first were there before this branch):

  • Calling add_onlap_unconformity twice on one feature now keeps both inverse regions. Calling it twice was already broken before this branch.
  • get_stratigraphic_surfaces(units=["unknown"]) returns [] with no warning.
  • A fault and a unit with the same name write to the same surface file.
  • save() to .json or .csv fails.

Tests: 65 passed and 2 skipped in the touched test files (test_geological_model, test_fault_topology, test_data_processor, test_unconformity_truncates_faults, test_unconformity_feature, test_exporters). save() was checked by hand for pkl, vtk and geoh5. Reviewed by a second agent: no important findings.

🤖 Generated with Claude Code

lachlangrose and others added 6 commits November 25, 2026 21:05
…dded

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… surfaces by unit

Iterate the stratigraphic groups, keep the stratigraphic_surfaces flag,
and name each data file after its data set so files do not overwrite.
get_stratigraphic_surfaces(units=...) now returns only those units.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Also adds the regression tests for model.save() and for the units filter.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…opology

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lachlangrose
lachlangrose merged commit 6449837 into master Nov 26, 2026
37 checks passed
@lachlangrose
lachlangrose deleted the fix/core-model-small-bugs branch November 26, 2026 00:45
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