Skip to content

Commit

Permalink
fix: catch dfi import error
Browse files Browse the repository at this point in the history
  • Loading branch information
Lachlan Grose committed Jun 23, 2022
1 parent be4d8ac commit f9c8aa0
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions LoopStructural/modelling/core/geological_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,18 @@
import pandas as pd
import LoopStructural
from LoopStructural.datasets import normal_vector_headers
from LoopStructural.interpolators import DiscreteFoldInterpolator as DFI

try:
from LoopStructural.interpolators import DiscreteFoldInterpolator as DFI

dfi = True
except ImportError:
dfi = False
from LoopStructural.interpolators import FiniteDifferenceInterpolator as FDI

try:
from LoopStructural.interpolators import PiecewiseLinearInterpolator as PLI

pli = True
except ImportError:
pli = False
Expand Down Expand Up @@ -43,7 +51,7 @@
UnconformityFeature,
StructuralFrame,
GeologicalFeature,
FeatureType
FeatureType,
)
from LoopStructural.modelling.features.fold import (
FoldRotationAngle,
Expand Down Expand Up @@ -774,7 +782,7 @@ def get_interpolator(
)
return FDI(grid)

if interpolatortype == "DFI": # "fold" in kwargs:
if interpolatortype == "DFI" and dfi == True: # "fold" in kwargs:
if element_volume is None:
nelements /= 5
element_volume = box_vol / nelements
Expand Down Expand Up @@ -823,7 +831,7 @@ def create_and_add_foliation(
the created geological feature
"""
if self.check_inialisation() == False:
return
return
# if tol is not specified use the model default
if tol is None:
tol = self.tol
Expand Down

0 comments on commit f9c8aa0

Please sign in to comment.