|
10 | 10 | from .sorter import Sorter, SorterAgeBased, SorterAlpha, SorterUseNetworkX, SorterUseHint |
11 | 11 | from .stratigraphic_column import StratigraphicColumn |
12 | 12 | from .deformation_history import DeformationHistory |
13 | | -from .map2model_wrapper import Map2ModelWrapper |
| 13 | +from .topology import run_topology, calculate_unit_unit_relationships |
14 | 14 | from .data_checks import validate_config_dictionary |
15 | 15 |
|
16 | 16 | # external imports |
@@ -47,8 +47,8 @@ class Project(object): |
47 | 47 | The name of the loop project file used in this project |
48 | 48 | map_data: MapData |
49 | 49 | The structure that holds all map and dtm data |
50 | | - map2model: Map2ModelWrapper |
51 | | - A wrapper around the map2model module that extracts unit and fault adjacency |
| 50 | + topology_results: dict |
| 51 | + A dictionary storing results from the topology process |
52 | 52 | stratigraphic_column: StratigraphicColumn |
53 | 53 | The structure that holds the unit information and ordering |
54 | 54 | deformation_history: DeformationHistory |
@@ -143,7 +143,7 @@ def __init__( |
143 | 143 | self.throw_calculator = ThrowCalculatorAlpha() |
144 | 144 | self.fault_orientation = FaultOrientationNearest() |
145 | 145 | self.map_data = MapData(verbose_level=verbose_level) |
146 | | - self.map2model = Map2ModelWrapper(self.map_data) |
| 146 | + self.topology_results = None |
147 | 147 | self.stratigraphic_column = StratigraphicColumn() |
148 | 148 | self.deformation_history = DeformationHistory(project=self) |
149 | 149 | self.loop_filename = loop_project_filename |
@@ -583,7 +583,7 @@ def calculate_stratigraphic_order(self, take_best=False): |
583 | 583 | columns = [ |
584 | 584 | sorter.sort( |
585 | 585 | self.stratigraphic_column.stratigraphicUnits, |
586 | | - self.map2model.get_unit_unit_relationships(), |
| 586 | + calculate_unit_unit_relationships(self.map_data), |
587 | 587 | self.map_data.contacts, |
588 | 588 | self.map_data, |
589 | 589 | ) |
@@ -613,7 +613,7 @@ def calculate_stratigraphic_order(self, take_best=False): |
613 | 613 | logger.info(f'Calculating stratigraphic column using sorter {self.sorter.sorter_label}') |
614 | 614 | self.stratigraphic_column.column = self.sorter.sort( |
615 | 615 | self.stratigraphic_column.stratigraphicUnits, |
616 | | - self.map2model.get_unit_unit_relationships(), |
| 616 | + calculate_unit_unit_relationships(self.map_data), |
617 | 617 | self.map_data.contacts, |
618 | 618 | self.map_data, |
619 | 619 | ) |
@@ -802,7 +802,7 @@ def run_all(self, user_defined_stratigraphic_column=None, take_best=False): |
802 | 802 | # Calculate the stratigraphic column |
803 | 803 | if issubclass(type(user_defined_stratigraphic_column), list): |
804 | 804 | self.stratigraphic_column.column = user_defined_stratigraphic_column |
805 | | - self.map2model.run() # if we use a user defined stratigraphic column, we still need to calculate the results of map2model |
| 805 | + self.topology_results = run_topology(self.map_data) |
806 | 806 | else: |
807 | 807 | if user_defined_stratigraphic_column is not None: |
808 | 808 | logger.warning( |
@@ -1050,9 +1050,9 @@ def save_into_projectfile(self): |
1050 | 1050 | observations["dipPolarity"] = self.structure_samples["OVERTURNED"] |
1051 | 1051 | LPF.Set(self.loop_filename, "stratigraphicObservations", data=observations) |
1052 | 1052 |
|
1053 | | - if self.map2model.fault_fault_relationships is not None: |
| 1053 | + if self.topology_results and self.topology_results.get("fault_fault_relationships") is not None: |
1054 | 1054 | ff_relationships = self.deformation_history.get_fault_relationships_with_ids( |
1055 | | - self.map2model.fault_fault_relationships |
| 1055 | + self.topology_results["fault_fault_relationships"] |
1056 | 1056 | ) |
1057 | 1057 | relationships = numpy.zeros(len(ff_relationships), LPF.eventRelationshipType) |
1058 | 1058 |
|
|
0 commit comments