Skip to content

Commit

Permalink
fix: fixing import warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
lachlangrose committed Mar 6, 2022
1 parent 5a8fd76 commit 3b5c0f3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion LoopStructural/modelling/intrusions/intrusion_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

except ImportError:
logger.error("skfmm not installed \n" "pip install scikit-fmm")


class IntrusionBuilder(StructuralFrameBuilder):
def __init__(
Expand Down
16 changes: 10 additions & 6 deletions LoopStructural/modelling/intrusions/intrusion_feature.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,15 @@
# import GSLIB library
try:
import geostatspy.GSLIB as GSLIB # GSLIB utilities, viz and wrapped functions
import geostatspy.geostats as geostats # GSLIB converted to Python

except ImportError:
logger.error("GeostatPy not installed \n" "pip install geostatspy")

raise ImportError('GSLIB')
try:
import geostatspy.geostats as geostats # GSLIB converted to Python
except ImportError:
logger.error("GeostatPy not installed \n" "pip install geostatspy")
raise ImportError('geostats')
from LoopStructural.modelling.intrusions.intrusion_support_functions import *


Expand Down Expand Up @@ -467,8 +471,8 @@ def simulate_lateral_thresholds(self):
ndmax = self.lateral_sgs_parameters.get("ndmax")
radius = self.lateral_sgs_parameters.get("radius")

if geostats is None:
raise Exception("geostats is not installed, pip install geostatspy")
# if geostats is None:
# raise Exception("geostats is not installed, pip install geostatspy")
l_min_simulation = geostats.sgsim(
inputsimdata_minL,
"coord1",
Expand Down Expand Up @@ -945,10 +949,10 @@ def evaluate_value(self, points):
)

s_min = np.around(
si_s / si_s.min(axis=1)[:, None], 2
si_s / (si_s.min(axis=1)[:, None]+np.finfo('float').eps), 2
) # flag with 1 the minimum value
p_min = np.around(
pi_p / pi_p.min(axis=1)[:, None], 2
pi_p / (pi_p.min(axis=1)[:, None]+np.finfo('float').eps), 2
) # flag with 1 the minimum value

indexG = np.argmin(abs(1 - (s_min * p_min)), axis=1)
Expand Down

0 comments on commit 3b5c0f3

Please sign in to comment.