Skip to content
Merged
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
39 changes: 14 additions & 25 deletions pyenzyme/thinlayers/__init__.py
Original file line number Diff line number Diff line change
@@ -1,36 +1,25 @@
from .base import BaseThinLayer

# Only import and show warnings if the modules are explicitly requested
ThinLayerPysces = None
ThinLayerCopasi = None


def _get_pysces():
global ThinLayerPysces
if ThinLayerPysces is None:
try:
from .psyces import ThinLayerPysces as _ThinLayerPysces

ThinLayerPysces = _ThinLayerPysces
except ImportError as e:
raise ImportError(
f"ThinLayerPysces is not available because of missing dependencies: {e}"
)
return ThinLayerPysces
try:
from .psyces import ThinLayerPysces as _ThinLayerPysces
except ImportError as e:
raise ImportError(
f"ThinLayerPysces is not available because of missing dependencies: {e}"
)
return _ThinLayerPysces


def _get_copasi():
global ThinLayerCopasi
if ThinLayerCopasi is None:
try:
from .basico import ThinLayerCopasi as _ThinLayerCopasi

ThinLayerCopasi = _ThinLayerCopasi
except ImportError as e:
raise ImportError(
f"ThinLayerCopasi is not available because of missing dependencies: {e}"
)
return ThinLayerCopasi
try:
from .basico import ThinLayerCopasi as _ThinLayerCopasi
except ImportError as e:
raise ImportError(
f"ThinLayerCopasi is not available because of missing dependencies: {e}"
)
return _ThinLayerCopasi


def __getattr__(name):
Expand Down