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