diff --git a/LoopStructural/interpolators/__init__.py b/LoopStructural/interpolators/__init__.py index 7fdc3ade..56e68480 100644 --- a/LoopStructural/interpolators/__init__.py +++ b/LoopStructural/interpolators/__init__.py @@ -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, diff --git a/LoopStructural/modelling/__init__.py b/LoopStructural/modelling/__init__.py index 4e3e30d0..c25e12f0 100644 --- a/LoopStructural/modelling/__init__.py +++ b/LoopStructural/modelling/__init__.py @@ -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." + ) +