Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions LoopStructural/interpolators/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,16 @@ class InterpolatorType(IntEnum):
try:
from ..interpolators._surfe_wrapper import SurfeRBFInterpolator
except ImportError:
logger.warning("Surfe is not installed, SurfeRBFInterpolator will not be available")
SurfeRBFInterpolator = None
class SurfeRBFInterpolator(GeologicalInterpolator):
"""
Dummy class to handle the case where Surfe is not installed.
This will raise a warning when used.
"""

def __init__(self, *args, **kwargs):
raise ImportError(
"Surfe cannot be imported. Please install Surfe. pip install surfe/ conda install -c loop3d surfe"
)
interpolator_map = {
InterpolatorType.BASE: GeologicalInterpolator,
InterpolatorType.BASE_DISCRETE: DiscreteInterpolator,
Expand Down
14 changes: 11 additions & 3 deletions LoopStructural/modelling/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@
try:
from ..modelling.input.project_file import LoopProjectfileProcessor
except (LoopImportError, ImportError):
logger.warning(
"Cannot use LoopProjectfileProcessor: Loop project file cannot be imported, try installing LoopProjectFile"
)
class LoopProjectfileProcessor(ProcessInputData):
"""
Dummy class to handle the case where LoopProjectFile is not installed.
This will raise a warning when used.
"""

def __init__(self, *args, **kwargs):
raise LoopImportError(
"LoopProjectFile cannot be imported. Please install LoopProjectFile."
)

Loading