diff --git a/map2loop/deformation_history.py b/map2loop/deformation_history.py index fb906e5..050d03d 100644 --- a/map2loop/deformation_history.py +++ b/map2loop/deformation_history.py @@ -4,7 +4,6 @@ import geopandas import math - class DeformationHistory: """ A class containing all the fault and fold summaries and relationships @@ -285,12 +284,16 @@ def get_fault_relationships_with_ids(self, fault_fault_relationships: pandas.Dat Returns: pandas.DataFrame: The fault_relationships with the correct eventIds """ + faultIds = self.get_faults_for_export()[["eventId", "name"]].copy() rel = fault_fault_relationships.copy() - rel = rel.merge(faultIds, left_on="Fault1", right_on="name") + rel['Fault1'] = rel['Fault1'].astype(str) + rel['Fault2'] = rel['Fault2'].astype(str) + faultIds['eventId'] = faultIds['eventId'].astype(str) + rel = rel.merge(faultIds, left_on="Fault1", right_on="eventId") rel.rename(columns={"eventId": "eventId1"}, inplace=True) rel.drop(columns=["name"], inplace=True) - rel = rel.merge(faultIds, left_on="Fault2", right_on="name") + rel = rel.merge(faultIds, left_on="Fault2", right_on="eventId") rel.rename(columns={"eventId": "eventId2"}, inplace=True) rel.drop(columns=["name"], inplace=True) return rel diff --git a/map2loop/map2model_wrapper.py b/map2loop/map2model_wrapper.py index dd19601..3a0aec2 100644 --- a/map2loop/map2model_wrapper.py +++ b/map2loop/map2model_wrapper.py @@ -173,7 +173,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] + # 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)): relations[j] = [i.strip("()").replace(" ", "").split(",") for i in relations[j]] diff --git a/map2loop/project.py b/map2loop/project.py index a8d5fac..b766425 100644 --- a/map2loop/project.py +++ b/map2loop/project.py @@ -510,6 +510,7 @@ def run_all(self, user_defined_stratigraphic_column=None, take_best=False): # Calculate the stratigraphic column if issubclass(type(user_defined_stratigraphic_column), list): self.stratigraphic_column.column = user_defined_stratigraphic_column + self.map2model.run() # if we use a user defined stratigraphic column, we still need to calculate the results of map2model else: if user_defined_stratigraphic_column is not None: print(