From 61534d56919efe6141c81a025146c7209bc4ad57 Mon Sep 17 00:00:00 2001 From: JM Rohwer Date: Fri, 14 Nov 2025 15:07:57 +0100 Subject: [PATCH] Fix PySCeS and Copasi thinlayer imports --- pyenzyme/thinlayers/__init__.py | 39 ++++++++++++--------------------- 1 file changed, 14 insertions(+), 25 deletions(-) diff --git a/pyenzyme/thinlayers/__init__.py b/pyenzyme/thinlayers/__init__.py index 3e131f2..c8b7910 100644 --- a/pyenzyme/thinlayers/__init__.py +++ b/pyenzyme/thinlayers/__init__.py @@ -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):