From bb148307442adb75b2f8b035683878a66eef7d45 Mon Sep 17 00:00:00 2001 From: Hao-Wei Pang Date: Thu, 21 Mar 2024 17:48:40 -0400 Subject: [PATCH] update --- src/ReactionMechanismSimulator.jl | 67 +++++++++++++++++++------------ 1 file changed, 41 insertions(+), 26 deletions(-) diff --git a/src/ReactionMechanismSimulator.jl b/src/ReactionMechanismSimulator.jl index 374d4a88..16610a28 100644 --- a/src/ReactionMechanismSimulator.jl +++ b/src/ReactionMechanismSimulator.jl @@ -3,36 +3,51 @@ import Logging Logging.disable_logging(Logging.Warn) using PythonCall pyimport("sys").path.append("") +const Chem = Ref{Py}() +const Desc = Ref{Py}() +const molecule = Ref{Py}() +const chemkin = Ref{Py}() +const species = Ref{Py}() +const reaction = Ref{Py}() +const nasa = Ref{Py}() +const wilhoit = Ref{Py}() +const arrhenius = Ref{Py}() +const falloff = Ref{Py}() +const chebyshev = Ref{Py}() +const solvation = Ref{Py}() +const fragment = Ref{Py}() +const pydot = Ref{Py}() +const os = Ref{Py}() function __init__() - Chem = @pyconst(pyimport("rdkit.Chem")) - Desc = @pyconst(pyimport("rdkit.Chem.Descriptors")) + Chem[] = pyimport("rdkit.Chem") + Desc[] = pyimport("rdkit.Chem.Descriptors") try - molecule = @pyconst(pyimport("rmgpy.molecule")) - chemkin = @pyconst(pyimport("rmgpy.chemkin")) - species = @pyconst(pyimport("rmgpy.species")) - reaction = @pyconst(pyimport("rmgpy.reaction")) - nasa = @pyconst(pyimport("rmgpy.thermo.nasa")) - wilhoit = @pyconst(pyimport("rmgpy.thermo.wilhoit")) - arrhenius = @pyconst(pyimport("rmgpy.kinetics.arrhenius")) - falloff = @pyconst(pyimport("rmgpy.kinetics.falloff")) - chebyshev = @pyconst(pyimport("rmgpy.kinetics.chebyshev")) - solvation = @pyconst(pyimport("rmgpy.data.solvation")) - fragment = @pyconst(pyimport("rmgpy.molecule.fragment")) + molecule[] = pyimport("rmgpy.molecule") + chemkin[] = pyimport("rmgpy.chemkin") + species[] = pyimport("rmgpy.species") + reaction[] = pyimport("rmgpy.reaction") + nasa[] = pyimport("rmgpy.thermo.nasa") + wilhoit[] = pyimport("rmgpy.thermo.wilhoit") + arrhenius[] = pyimport("rmgpy.kinetics.arrhenius") + falloff[] = pyimport("rmgpy.kinetics.falloff") + chebyshev[] = pyimport("rmgpy.kinetics.chebyshev") + solvation[] = pyimport("rmgpy.data.solvation") + fragment[] = pyimport("rmgpy.molecule.fragment") catch e - molecule = @pyconst(pyimport("molecule.molecule")) - chemkin = @pyconst(pyimport("molecule.chemkin")) - species = @pyconst(pyimport("molecule.species")) - reaction = @pyconst(pyimport("molecule.reaction")) - nasa = @pyconst(pyimport("molecule.thermo.nasa")) - wilhoit = @pyconst(pyimport("molecule.thermo.wilhoit")) - arrhenius = @pyconst(pyimport("molecule.kinetics.arrhenius")) - falloff = @pyconst(pyimport("molecule.kinetics.falloff")) - chebyshev = @pyconst(pyimport("molecule.kinetics.chebyshev")) - solvation = @pyconst(pyimport("molecule.data.solvation")) - fragment = @pyconst(pyimport("molecule.molecule.fragment")) + molecule[] = pyimport("molecule.molecule") + chemkin[] = pyimport("molecule.chemkin") + species[] = pyimport("molecule.species") + reaction[] = pyimport("molecule.reaction") + nasa[] = pyimport("molecule.thermo.nasa") + wilhoit[] = pyimport("molecule.thermo.wilhoit") + arrhenius[] = pyimport("molecule.kinetics.arrhenius") + falloff[] = pyimport("molecule.kinetics.falloff") + chebyshev[] = pyimport("molecule.kinetics.chebyshev") + solvation[] = pyimport("molecule.data.solvation") + fragment[] = pyimport("molecule.molecule.fragment") end - pydot = @pyconst(pyimport("pydot")) - os = @pyconst(pyimport("os")) + pydot[] = pyimport("pydot") + os[] = pyimport("os") end include("Constants.jl") include("Tools.jl")