Skip to content

Commit

Permalink
fix: map2model fault fault relationships (#140)
Browse files Browse the repository at this point in the history
* fix: fault topology merge was using incorrect lookups

* fix: run map2model for user defined stratigraphic column

* removing logger from this pr

* fix: use fault id not Fault_{id}
  • Loading branch information
lachlangrose authored Nov 26, 2024
1 parent 8dca886 commit 56166f6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions map2loop/deformation_history.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import geopandas
import math


from .logging import getLogger

logger = getLogger(__name__)
Expand Down Expand Up @@ -280,6 +281,7 @@ def get_fault_relationships_with_ids(self, fault_fault_relationships: pandas.Dat
pandas.DataFrame: The fault_relationships with the correct eventIds
"""
logger.info("Getting fault relationships with eventIds")

faultIds = self.get_faults_for_export()[["eventId", "name"]].copy()
rel = fault_fault_relationships.copy()
rel['Fault1'] = rel['Fault1'].astype(str)
Expand Down
2 changes: 2 additions & 0 deletions map2loop/map2model_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ def run(self, verbose_level: VerboseLevel = None):
df[1] = [re.findall("\(.*?\)", i) for i in df[1]] # Valid escape for regex
df[0] = list(df[0].str.replace("^[0-9]*, ", "", regex=True))
df[0] = list(df[0].str.replace(", ", "", regex=False))

# df[0] = "Fault_" + df[0] #removed 7/10/24 as it seems to break the merge in
relations = df[1]
for j in range(len(relations)):
Expand All @@ -197,6 +198,7 @@ def run(self, verbose_level: VerboseLevel = None):

for _, row in df.iterrows():
for i in numpy.arange(len(row[1])):

out += [[row[0], row[1][i][0], row[1][i][1], float(row[1][i][2])]]

else:
Expand Down

0 comments on commit 56166f6

Please sign in to comment.