Skip to content

Commit 9f9bc89

Browse files
authored
Merge pull request #2364 from ReactionMechanismGenerator/Import_pyrms_during_debug
importing pyrms and diffeqpy during a debug session
2 parents 4e072c3 + a8c4127 commit 9f9bc89

File tree

1 file changed

+19
-6
lines changed

1 file changed

+19
-6
lines changed

rmgpy/rmg/reactors.py

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,25 @@
3535
import sys
3636
import logging
3737
import itertools
38-
try:
39-
from pyrms import rms
40-
from diffeqpy import de
41-
from julia import Main
42-
except:
43-
pass
38+
39+
if __debug__:
40+
try:
41+
from os.path import dirname, abspath, join, exists
42+
path_rms = dirname(dirname(dirname(abspath(__file__))))
43+
from julia.api import Julia
44+
jl = Julia(sysimage=join(path_rms,"rms.so")) if exists(join(path_rms,"rms.so")) else Julia(compiled_modules=False)
45+
from pyrms import rms
46+
from diffeqpy import de
47+
from julia import Main
48+
except:
49+
pass
50+
else:
51+
try:
52+
from pyrms import rms
53+
from diffeqpy import de
54+
from julia import Main
55+
except:
56+
pass
4457

4558
from rmgpy.species import Species
4659
from rmgpy.reaction import Reaction

0 commit comments

Comments
 (0)