1
1
module ReactionMechanismSimulator
2
- using PythonCall
3
2
using CondaPkg
4
3
using Logging
4
+ packages = keys (CondaPkg. current_packages ())
5
+
6
+ if ! (" rmg" in packages) && ! (" rmgmolecule" in packages)
7
+ @info " missing rmg and rmgmolecule installing rmgmolecule..."
8
+ if ! (v " 3.7" <= PythonCall. C. python_version () && PythonCall. C. python_version () <= v " 3.9" )
9
+ @info " python version was not in 3.7-3.9 changing python version"
10
+ CondaPkg. add (" python" ; version= " 3.9" )
11
+ end
12
+ CondaPkg. add (" rmgmolecule" ; version= " >=0.3.0" , channel= " mjohnson541" )
13
+ CondaPkg. add (" matplotlib" , channel= " conda-forge" )
14
+ CondaPkg. add (" rdkit" , channel= " conda-forge" )
15
+ CondaPkg. add (" pydot" , channel= " conda-forge" )
16
+
17
+ Pkgc = Base. require (Base. PkgId (Base. UUID (" 44cfe95a-1eb2-52ea-b672-e2afdf69b78f" ), " Pkg" ))
18
+ Pkgc. build (" PythonCall" )
19
+ end
20
+
21
+ using PythonCall
5
22
const Chem = PythonCall. pynew ()
6
23
const Desc = PythonCall. pynew ()
7
24
const molecule = PythonCall. pynew ()
@@ -18,22 +35,7 @@ const fragment = PythonCall.pynew()
18
35
const pydot = PythonCall. pynew ()
19
36
20
37
function __init__ ()
21
- packages = keys (CondaPkg. current_packages ())
22
-
23
- if ! (" rmg" in packages) && ! (" rmgmolecule" in packages)
24
- @info " missing rmg and rmgmolecule installing rmgmolecule..."
25
- if ! (v " 3.7" <= PythonCall. C. python_version () && PythonCall. C. python_version () <= v " 3.9" )
26
- @info " python version was not in 3.7-3.9 changing python version"
27
- CondaPkg. add (" python" ; version= " 3.9" )
28
- end
29
- CondaPkg. add (" rmgmolecule" ; version= " >=0.3.0" , channel= " mjohnson541" )
30
- CondaPkg. add (" matplotlib" , channel= " conda-forge" )
31
- CondaPkg. add (" rdkit" , channel= " conda-forge" )
32
- CondaPkg. add (" pydot" , channel= " conda-forge" )
33
-
34
- Pkgc = Base. require (Base. PkgId (Base. UUID (" 44cfe95a-1eb2-52ea-b672-e2afdf69b78f" ), " Pkg" ))
35
- Pkgc. build (" PythonCall" )
36
- end
38
+
37
39
@error " packages"
38
40
@error keys (CondaPkg. current_packages ())
39
41
PythonCall. pycopy! (Chem, pyimport (" rdkit.Chem" ))
0 commit comments