Skip to content

Commit

Permalink
fix: Remove deprecation ignore warnings and then deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
RoyThomsonMonash committed Jan 25, 2024
1 parent d0f3b37 commit 79cd333
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 26 deletions.
36 changes: 18 additions & 18 deletions map2loop/deformation_history.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 0 additions & 5 deletions map2loop/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand Down
2 changes: 1 addition & 1 deletion map2loop/stratigraphic_column.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions map2loop/thickness_calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"])
Expand Down

0 comments on commit 79cd333

Please sign in to comment.