Skip to content

fix: correct fault-proximity gradient retry loop and stop set_stratigraphic_column from wiping state - #304

Merged
lachlangrose merged 2 commits into
split/01-intrusions-fixfrom
split/05-fault-proximity-fix
Aug 14, 2026
Merged

fix: correct fault-proximity gradient retry loop and stop set_stratigraphic_column from wiping state#304
lachlangrose merged 2 commits into
split/01-intrusions-fixfrom
split/05-fault-proximity-fix

Conversation

@lachlangrose

Copy link
Copy Markdown
Member

Split out of #298 / #299. PR 5 of 9 in the stack — depends on #300 (base branch only; this fix doesn't touch intrusions code). Starts the "core refactor" line of the stack, independent of the map2loop/visualisation line (#301-#303).

Fixes #296: set_stratigraphic_column raised DeprecationWarning unconditionally, which broke GeologicalModel.from_processor. Emits the warning with warnings.warn instead so the legacy dict format keeps working. Also corrects the fault-proximity gradient retry loop in _geological_feature.py.

- Added a new method `_validate_intrusion_inputs` in `GeologicalModel` to validate inputs for intrusions, ensuring necessary data is present before processing.
- Updated `_build_intrusion` to call the new validation method, improving error handling for missing data.
- Refactored `IntrusionBuilder.create_geometry_using_geometric_scaling` to clarify that geometric scaling is not currently implemented, raising a `NotImplementedError` immediately.
- Simplified threshold handling in `IntrusionFeature` by removing redundant checks for marginal faults.
- Removed the unused `intrusion_support_functions.py` file to clean up the codebase.
- Updated tests in `test_intrusions.py` to cover new validation logic, ensuring clear error messages for missing data and parameters.
- Added regression tests for previously silent errors related to weight handling and geometric scaling.

(cherry picked from commit 8cb80c1)
…raphic_column from wiping state

evaluate_gradient's tetrahedron-refinement loop set resolved=True
unconditionally after one pass, so it never actually retried after
shrinking the tetrahedron near a fault. set_stratigraphic_column
cleared the model's stratigraphic column before unconditionally
raising DeprecationWarning, destroying existing state on every call.

(cherry picked from commit 647fe5d)
@lachlangrose
lachlangrose force-pushed the split/05-fault-proximity-fix branch from 9c0a278 to 0370ed2 Compare August 14, 2026 11:29
@lachlangrose
lachlangrose merged commit 5560630 into split/01-intrusions-fix Aug 14, 2026
1 check passed
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