Skip to content

Commit

Permalink
fix: pli import is optional
Browse files Browse the repository at this point in the history
  • Loading branch information
Lachlan Grose committed Jun 16, 2022
1 parent a0e94bb commit 6347742
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions LoopStructural/modelling/core/geological_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@
from LoopStructural.datasets import normal_vector_headers
from LoopStructural.interpolators import DiscreteFoldInterpolator as DFI
from LoopStructural.interpolators import FiniteDifferenceInterpolator as FDI
from LoopStructural.interpolators import PiecewiseLinearInterpolator as PLI
try:
from LoopStructural.interpolators import PiecewiseLinearInterpolator as PLI
pli = True
except ImportError:
pli = False

# if LoopStructural.experimental:
from LoopStructural.interpolators import P2Interpolator
Expand Down Expand Up @@ -665,7 +669,7 @@ def get_interpolator(
bb[0, :] -= buffer # *(bb[1,:]-bb[0,:])
bb[1, :] += buffer # *(bb[1,:]-bb[0,:])
box_vol = (bb[1, 0] - bb[0, 0]) * (bb[1, 1] - bb[0, 1]) * (bb[1, 2] - bb[0, 2])
if interpolatortype == "PLI":
if interpolatortype == "PLI" and pli:
if element_volume is None:
# nelements /= 5
element_volume = box_vol / nelements
Expand Down

0 comments on commit 6347742

Please sign in to comment.