Skip to content

Commit bc4ca17

Browse files
committed
fix: add remove fault
1 parent f771cdd commit bc4ca17

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

LoopStructural/modelling/core/fault_topology.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,22 @@ def add_fault(self, fault: FaultSegment):
2727

2828
self.faults.append(fault)
2929
self.notify('fault_added', fault=fault)
30+
31+
def remove_fault(self, fault: str):
32+
"""
33+
Removes a fault from the fault topology.
34+
"""
35+
if fault not in self.faults:
36+
raise ValueError(f"Fault {fault} not found in the topology.")
37+
38+
self.faults.remove(fault)
39+
# Remove any relationships involving this fault
40+
self.adjacency = {k: v for k, v in self.adjacency.items() if fault not in k}
41+
self.stratigraphy_fault_relationships = {
42+
k: v for k, v in self.stratigraphy_fault_relationships.items() if k[1] != fault
43+
}
44+
self.notify('fault_removed', fault=fault)
45+
3046
def add_abutting_relationship(self, fault_name: str, abutting_fault: str):
3147
"""
3248
Adds an abutting relationship between two faults.

0 commit comments

Comments
 (0)