Skip to content

Commit b9d275a

Browse files
committed
first look for rmgpy, then look for molecule, then install molecule
1 parent eed1896 commit b9d275a

File tree

3 files changed

+34
-13
lines changed

3 files changed

+34
-13
lines changed

deps/build.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ if PyCall.pyversion.major != 3 || PyCall.pyversion.minor != 7
99
end
1010
Conda.add("nomkl")
1111
Conda.add("numpy")
12-
Conda.add_channel("hwpang")
13-
Conda.add("rmgmolecule")
12+
try
13+
pyimport("rmgpy")
14+
catch e
15+
Conda.add_channel("hwpang")
16+
Conda.add("rmgmolecule")
17+
end
1418
Pkg.build("PyCall")
1519
end

src/ReactionMechanismSimulator.jl

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,30 @@ module ReactionMechanismSimulator
1818
function __init__()
1919
copy!(Chem,pyimport_conda("rdkit.Chem","rdkit","rmg"))
2020
copy!(Desc,pyimport_conda("rdkit.Chem.Descriptors","rdkit","rmg"))
21-
copy!(molecule,pyimport_conda("molecule.molecule","rmgmolecule","hwpang"))
21+
try
22+
copy!(molecule,pyimport("rmgpy.molecule"))
23+
copy!(chemkin,pyimport("rmgpy.chemkin"))
24+
copy!(species,pyimport("rmgpy.species"))
25+
copy!(reaction,pyimport("rmgpy.reaction"))
26+
copy!(nasa,pyimport("rmgpy.thermo.nasa"))
27+
copy!(wilhoit,pyimport("rmgpy.thermo.wilhoit"))
28+
copy!(arrhenius,pyimport("rmgpy.kinetics.arrhenius"))
29+
copy!(falloff,pyimport("rmgpy.kinetics.falloff"))
30+
copy!(chebyshev,pyimport("rmgpy.kinetics.chebyshev"))
31+
copy!(solvation,pyimport("rmgpy.data.solvation"))
32+
catch e
33+
copy!(molecule,pyimport_conda("molecule.molecule","rmgmolecule","hwpang"))
34+
copy!(chemkin,pyimport_conda("molecule.chemkin","rmgmolecule","hwpang"))
35+
copy!(species,pyimport_conda("molecule.species","rmgmolecule","hwpang"))
36+
copy!(reaction,pyimport_conda("molecule.reaction","rmgmolecule","hwpang"))
37+
copy!(nasa,pyimport_conda("molecule.thermo.nasa","rmgmolecule","hwpang"))
38+
copy!(wilhoit,pyimport_conda("molecule.thermo.wilhoit","rmgmolecule","hwpang"))
39+
copy!(arrhenius,pyimport_conda("molecule.kinetics.arrhenius","rmgmolecule","hwpang"))
40+
copy!(falloff,pyimport_conda("molecule.kinetics.falloff","rmgmolecule","hwpang"))
41+
copy!(chebyshev,pyimport_conda("molecule.kinetics.chebyshev","rmgmolecule","hwpang"))
42+
copy!(solvation,pyimport_conda("molecule.data.solvation","rmgmolecule","hwpang"))
43+
end
2244
copy!(pydot,pyimport_conda("pydot","pydot"))
23-
copy!(chemkin,pyimport_conda("molecule.chemkin","rmgmolecule","hwpang"))
24-
copy!(species,pyimport_conda("molecule.species","rmgmolecule","hwpang"))
25-
copy!(reaction,pyimport_conda("molecule.reaction","rmgmolecule","hwpang"))
26-
copy!(nasa,pyimport_conda("molecule.thermo.nasa","rmgmolecule","hwpang"))
27-
copy!(wilhoit,pyimport_conda("molecule.thermo.wilhoit","rmgmolecule","hwpang"))
28-
copy!(arrhenius,pyimport_conda("molecule.kinetics.arrhenius","rmgmolecule","hwpang"))
29-
copy!(falloff,pyimport_conda("molecule.kinetics.falloff","rmgmolecule","hwpang"))
30-
copy!(chebyshev,pyimport_conda("molecule.kinetics.chebyshev","rmgmolecule","hwpang"))
31-
copy!(solvation,pyimport_conda("molecule.data.solvation","rmgmolecule","hwpang"))
3245
copy!(os,pyimport_conda("os","os"))
3346
end
3447
include("Constants.jl")

src/rmstest.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ const Chem = PyNULL()
33
const molecule = PyNULL()
44
const pydot = PyNULL()
55
copy!(Chem,pyimport_conda("rdkit.Chem","rdkit","rmg"))
6-
copy!(molecule, pyimport_conda("molecule.molecule", "rmgmolecule", "hwpang"))
6+
try
7+
copy!(molecule, pyimport("rmgpy.molecule"))
8+
catch e
9+
copy!(molecule, pyimport_conda("molecule.molecule", "rmgmolecule", "hwpang"))
10+
end
711
copy!(pydot,pyimport_conda("pydot","pydot","rmg"))
812

913

0 commit comments

Comments
 (0)