diff --git a/splipy/io/__init__.py b/splipy/io/__init__.py index 6aaad3c..9e44cca 100644 --- a/splipy/io/__init__.py +++ b/splipy/io/__init__.py @@ -4,27 +4,23 @@ from .stl import STL from .ofoam import OpenFOAM +__all__ = ['G2', 'SVG', 'SPL', 'STL', 'OpenFOAM'] from importlib.util import find_spec + + has_cv2 = find_spec('cv2') -has_rhino = find_spec('rhino3dm') # GRDECL depends on optional cv2 has_grdecl = has_cv2 -if has_cv2: - pass - - -# ThreeDM depends on optional rhino3dm -if has_rhino: - pass - - -__all__ = ['G2', 'SVG', 'SPL', 'STL', 'OpenFOAM'] - if has_grdecl: + from .grdecl import GRDECL __all__.append('GRDECL') + +# ThreeDM depends on optional rhino3dm +has_rhino = find_spec('rhino3dm') if has_rhino: + from .threedm import ThreeDM __all__.append('ThreeDM')