diff --git a/map2loop/deformation_history.py b/map2loop/deformation_history.py index b36dc9f2..ea46730d 100644 --- a/map2loop/deformation_history.py +++ b/map2loop/deformation_history.py @@ -212,30 +212,30 @@ def populate(self, faults_map_data: geopandas.GeoDataFrame): ) self.faults["eventId"] = faults_data["ID"] self.faults["name"] = faults_data["NAME"] - self.faults["minAge"] = -1 - self.faults["maxAge"] = -1 + self.faults["minAge"] = -1.0 + self.faults["maxAge"] = -1.0 self.faults["group"] = "" self.faults["supergroup"] = "" - self.faults["avgDisplacement"] = -1 - self.faults["avgDownthrowDir"] = 0 - self.faults["influenceDistance"] = 0 - self.faults["verticalRadius"] = 0 - self.faults["horizontalRadius"] = 0 + self.faults["avgDisplacement"] = -1.0 + self.faults["avgDownthrowDir"] = 0.0 + self.faults["influenceDistance"] = 0.0 + self.faults["verticalRadius"] = 0.0 + self.faults["horizontalRadius"] = 0.0 self.faults["colour"] = "#000000" - self.faults["centreX"] = 0 - self.faults["centreY"] = 0 - self.faults["centreZ"] = 0 - self.faults["avgSlipDirX"] = 0 - self.faults["avgSlipDirY"] = 0 - self.faults["avgSlipDirZ"] = 0 - self.faults["avgNormalX"] = 0 - self.faults["avgNormalY"] = 0 - self.faults["avgNormalZ"] = 0 + self.faults["centreX"] = 0.0 + self.faults["centreY"] = 0.0 + self.faults["centreZ"] = 0.0 + self.faults["avgSlipDirX"] = 0.0 + self.faults["avgSlipDirY"] = 0.0 + self.faults["avgSlipDirZ"] = 0.0 + self.faults["avgNormalX"] = 0.0 + self.faults["avgNormalY"] = 0.0 + self.faults["avgNormalZ"] = 0.0 self.faults["length"] = faults_data.geometry.length for index, fault in self.faults.iterrows(): bounds = faults_map_data[faults_map_data["ID"] == fault["eventId"]].geometry.bounds - xdist = bounds.maxx - bounds.minx - ydist = bounds.maxy - bounds.miny + xdist = float(bounds.maxx.iloc[0] - bounds.minx.iloc[0]) + ydist = float(bounds.maxy.iloc[0] - bounds.miny.iloc[0]) length = math.sqrt(xdist*xdist + ydist*ydist) self.faults.at[index, "verticalRadius"] = length self.faults.at[index, "horizontalRadius"] = length / 2.0 diff --git a/map2loop/project.py b/map2loop/project.py index 0a24dd32..5ed0afd7 100644 --- a/map2loop/project.py +++ b/map2loop/project.py @@ -18,11 +18,6 @@ from matplotlib.colors import to_rgba from osgeo import gdal -# TODO: When geopandas gets updated check that this FutureWarning supression -# is still needed for GeoDataFrame.clip methods -import warnings -warnings.simplefilter(action="ignore", category=FutureWarning) - class Project(object): """ diff --git a/map2loop/stratigraphic_column.py b/map2loop/stratigraphic_column.py index 7c1733a7..a453b284 100644 --- a/map2loop/stratigraphic_column.py +++ b/map2loop/stratigraphic_column.py @@ -161,7 +161,7 @@ def populate(self, geology_map_data: geopandas.GeoDataFrame): self.stratigraphicUnits["maxAge"] = geology_data["MAX_AGE"] self.stratigraphicUnits["group"] = geology_data["GROUP"] self.stratigraphicUnits["supergroup"] = geology_data["SUPERGROUP"] - self.stratigraphicUnits["thickness"] = -1 + self.stratigraphicUnits["thickness"] = -1.0 self.stratigraphicUnits["colour"] = "#000000" # self.stratigraphicUnits["indexInGroup"] = -1 diff --git a/map2loop/thickness_calculator.py b/map2loop/thickness_calculator.py index 985609a6..4001a6db 100644 --- a/map2loop/thickness_calculator.py +++ b/map2loop/thickness_calculator.py @@ -73,7 +73,7 @@ def compute(self, units: pandas.DataFrame, stratigraphic_order: list, basal_cont """ # TODO: If we have orientation data near basal contact points we can estimate # the actual distance between contacts rather than just using the horizontal distance - no_distance = -1 + no_distance = -1.0 basal_contacts = basal_contacts[basal_contacts["type"] == "BASAL"] thicknesses = units.copy() # Set default value @@ -97,7 +97,7 @@ def compute(self, units: pandas.DataFrame, stratigraphic_order: list, basal_cont # Maximum thickness is the horizontal distance between the minimum of these distances # Find row in unit_dataframe corresponding to unit and replace thickness value if it is -1 or larger than distance idx = thicknesses.index[thicknesses["name"] == stratigraphic_order[i]].tolist()[0] - if thicknesses.loc[idx, "thickness"] == -1: + if thicknesses.loc[idx, "thickness"] <= -1.0: val = distance else: val = min(distance, thicknesses.at[idx, "thickness"])