Skip to content

Commit 61534d5

Browse files
committed
Fix PySCeS and Copasi thinlayer imports
1 parent f64d1fc commit 61534d5

File tree

1 file changed

+14
-25
lines changed

1 file changed

+14
-25
lines changed

pyenzyme/thinlayers/__init__.py

Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,25 @@
11
from .base import BaseThinLayer
22

3-
# Only import and show warnings if the modules are explicitly requested
4-
ThinLayerPysces = None
5-
ThinLayerCopasi = None
6-
7-
83
def _get_pysces():
94
global ThinLayerPysces
10-
if ThinLayerPysces is None:
11-
try:
12-
from .psyces import ThinLayerPysces as _ThinLayerPysces
13-
14-
ThinLayerPysces = _ThinLayerPysces
15-
except ImportError as e:
16-
raise ImportError(
17-
f"ThinLayerPysces is not available because of missing dependencies: {e}"
18-
)
19-
return ThinLayerPysces
5+
try:
6+
from .psyces import ThinLayerPysces as _ThinLayerPysces
7+
except ImportError as e:
8+
raise ImportError(
9+
f"ThinLayerPysces is not available because of missing dependencies: {e}"
10+
)
11+
return _ThinLayerPysces
2012

2113

2214
def _get_copasi():
2315
global ThinLayerCopasi
24-
if ThinLayerCopasi is None:
25-
try:
26-
from .basico import ThinLayerCopasi as _ThinLayerCopasi
27-
28-
ThinLayerCopasi = _ThinLayerCopasi
29-
except ImportError as e:
30-
raise ImportError(
31-
f"ThinLayerCopasi is not available because of missing dependencies: {e}"
32-
)
33-
return ThinLayerCopasi
16+
try:
17+
from .basico import ThinLayerCopasi as _ThinLayerCopasi
18+
except ImportError as e:
19+
raise ImportError(
20+
f"ThinLayerCopasi is not available because of missing dependencies: {e}"
21+
)
22+
return _ThinLayerCopasi
3423

3524

3625
def __getattr__(name):

0 commit comments

Comments
 (0)