Skip to content

Commit bb04d75

Browse files
committed
debug
1 parent 1f37bfd commit bb04d75

File tree

6 files changed

+84
-136
lines changed

6 files changed

+84
-136
lines changed

.github/workflows/CI.yml

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ jobs:
1010
test:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v2
13+
- uses: actions/checkout@v4
1414
- uses: julia-actions/setup-julia@v1
1515
with:
16-
version: 1.8
16+
version: '1.10'
1717
- uses: actions/cache@v1
1818
env:
1919
cache-name: cache-artifacts
@@ -24,21 +24,13 @@ jobs:
2424
${{ runner.os }}-test-${{ env.cache-name }}-
2525
${{ runner.os }}-test-
2626
${{ runner.os }}-
27-
- uses: conda-incubator/setup-miniconda@v2
28-
with:
29-
environment-file: environment.yml
30-
python-version: 3.7
31-
activate-environment: rms_env
32-
- name: Fix PyCall linking
33-
run: |
34-
julia -e 'ENV["PYTHON"]=ENV["CONDA"] * "/envs/rms_env/bin/python"; using Pkg; Pkg.add("PyCall"); Pkg.build("PyCall")'
3527
- uses: julia-actions/julia-buildpkg@v1
3628
- name: Build
3729
run: |
38-
julia -e 'using Pkg; Pkg.develop(PackageSpec(path="../ReactionMechanismSimulator.jl")); Pkg.build("ReactionMechanismSimulator");'
30+
julia -e 'using Pkg; Pkg.develop(Pkg.PackageSpec(path="../ReactionMechanismSimulator.jl/")); Pkg.build("ReactionMechanismSimulator");'
3931
- name: Run tests
4032
run: |
41-
julia -e 'using Pkg; Pkg.test("ReactionMechanismSimulator";coverage=true)'
33+
julia -e 'using Pkg; Pkg.test("ReactionMechanismSimulator"; coverage=true)'
4234
- uses: julia-actions/julia-processcoverage@v1
4335
- uses: codecov/codecov-action@v1
4436
with:

.github/workflows/documentation.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,9 @@ jobs:
1616
- uses: actions/checkout@v2
1717
- uses: julia-actions/setup-julia@latest
1818
with:
19-
version: 1.8
20-
- uses: conda-incubator/setup-miniconda@v2
21-
with:
22-
environment-file: environment.yml
23-
python-version: 3.7
24-
activate-environment: rms_env
19+
version: '1.10'
2520
- name: Install dependencies
2621
run: |
27-
julia -e 'ENV["PYTHON"]=ENV["CONDA"] * "/envs/rms_env/bin/python"; using Pkg; Pkg.add("PyCall"); Pkg.build("PyCall")'
2822
julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate();'
2923
- name: Build and deploy
3024
env:

Project.toml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ version = "1.0.0"
66
[deps]
77
Calculus = "49dc2e85-a5d0-5ad3-a950-438e2897f1b9"
88
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"
9-
Conda = "8f4d0f93-b110-5947-807f-2305c1781a2d"
9+
CondaPkg = "992eb4ea-22a4-4c89-a5bb-47a3300528ab"
1010
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
1111
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
1212
FastGaussQuadrature = "442a2c76-b920-505d-bb47-c5924d526838"
@@ -21,8 +21,8 @@ ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78"
2121
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
2222
Parameters = "d96e819e-fc66-5662-9728-84c9c7592b0a"
2323
PreallocationTools = "d236fae5-4411-538c-8e31-a6e3d9e00b46"
24-
PyCall = "438e738f-606a-5dbb-bf0a-cddfbfd45ab0"
25-
PyPlot = "d330b81b-6aea-500a-939a-2ce795aea3ee"
24+
PythonCall = "6099a3de-0909-46bc-b1f4-468b9a2dfc0d"
25+
PythonPlot = "274fc56d-3b97-40fa-a1cd-1b4a50311bf9"
2626
QuartzImageIO = "dca85d43-d64c-5e67-8c65-017450d5d020"
2727
RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd"
2828
ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267"
@@ -39,12 +39,11 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
3939
Tracker = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c"
4040
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"
4141
YAML = "ddb6d928-2868-570f-bddf-ab3f9cf99eb6"
42-
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"
4342

4443
[compat]
4544
Calculus = "0.4,0.5"
4645
Colors = "0.11,0.12"
47-
Conda = "1"
46+
CondaPkg = "0"
4847
CSV = "0.10"
4948
DataFrames = "1"
5049
SciMLSensitivity = "^7"
@@ -58,8 +57,8 @@ ModelingToolkit = "8"
5857
OrdinaryDiffEq = "^6"
5958
Parameters = "0.12"
6059
PreallocationTools = "0.4"
61-
PyCall = "1"
62-
PyPlot = "2"
60+
PythonCall = "0"
61+
PythonPlot = "1"
6362
QuartzImageIO = "0.7"
6463
RecursiveArrayTools = "2.17"
6564
ReverseDiff = "1.9"
@@ -72,5 +71,4 @@ Symbolics = "4"
7271
Tracker = "0.2"
7372
Unitful = "^1.3"
7473
YAML = "0.4"
75-
Zygote = "0.5,0.6"
7674
julia = "^1.6"

deps/build.jl

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,12 @@
1-
using PyCall
2-
using Conda
3-
packages = Conda._installed_packages()
4-
if !("rmg" in packages) && !("rmgmolecule" in packages) && (PyCall.pyversion.major != 3 || PyCall.pyversion.minor != 7)
1+
using CondaPkg
2+
using PythonCall
3+
packages = keys(CondaPkg.current_packages())
4+
if !("rmg" in packages) && !("rmgmolecule" in packages) || !(v"3.7" <= PythonCall.C.python_version() && PythonCall.C.python_version() <= v"3.9")
55
const Pkg = Base.require(Base.PkgId(Base.UUID("44cfe95a-1eb2-52ea-b672-e2afdf69b78f"), "Pkg"))
6-
Conda.rm("mamba")
7-
Conda.add("conda=4")
8-
Conda.add("mamba")
9-
Conda.update()
10-
Conda.add("python=3.7")
11-
try
12-
Conda.rm("numpy") #get around MKL problem
13-
catch e
14-
end
15-
Conda.add("nomkl")
16-
Conda.add("numpy")
17-
Conda.add_channel("mjohnson541")
18-
Conda.add_channel("hwpang")
19-
Conda.add("rmgmolecule")
20-
Pkg.build("PyCall")
6+
CondaPkg.add("python"; version="3.9")
7+
CondaPkg.add("matplotlib")
8+
CondaPkg.add("rdkit")
9+
CondaPkg.add("pydot")
10+
CondaPkg.add("rmgmolecule"; version=">=0.3.0", channel="mjohnson541")
11+
Pkg.build("PythonCall")
2112
end

environment.yml

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/ReactionMechanismSimulator.jl

Lines changed: 63 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,67 @@
1+
module ReactionMechanismSimulator
12
import Logging
23
Logging.disable_logging(Logging.Warn)
3-
4-
module ReactionMechanismSimulator
5-
using PyCall
6-
push!(PyVector(pyimport("sys")["path"]), "")
7-
const Chem = PyNULL()
8-
const Desc = PyNULL()
9-
const molecule = PyNULL()
10-
const fragment = PyNULL()
11-
const pydot = PyNULL()
12-
const chemkin =PyNULL()
13-
const species = PyNULL()
14-
const reaction = PyNULL()
15-
const nasa = PyNULL()
16-
const wilhoit = PyNULL()
17-
const arrhenius = PyNULL()
18-
const falloff = PyNULL()
19-
const chebyshev = PyNULL()
20-
const solvation = PyNULL()
21-
const os = PyNULL()
22-
function __init__()
23-
copy!(Chem,pyimport_conda("rdkit.Chem","rdkit","rmg"))
24-
copy!(Desc,pyimport_conda("rdkit.Chem.Descriptors","rdkit","rmg"))
25-
try
26-
copy!(molecule,pyimport("rmgpy.molecule"))
27-
copy!(chemkin,pyimport("rmgpy.chemkin"))
28-
copy!(species,pyimport("rmgpy.species"))
29-
copy!(reaction,pyimport("rmgpy.reaction"))
30-
copy!(nasa,pyimport("rmgpy.thermo.nasa"))
31-
copy!(wilhoit,pyimport("rmgpy.thermo.wilhoit"))
32-
copy!(arrhenius,pyimport("rmgpy.kinetics.arrhenius"))
33-
copy!(falloff,pyimport("rmgpy.kinetics.falloff"))
34-
copy!(chebyshev,pyimport("rmgpy.kinetics.chebyshev"))
35-
copy!(solvation,pyimport("rmgpy.data.solvation"))
36-
copy!(fragment,pyimport("rmgpy.molecule.fragment"))
37-
catch e
38-
copy!(molecule,pyimport_conda("molecule.molecule","rmgmolecule","hwpang"))
39-
copy!(chemkin,pyimport_conda("molecule.chemkin","rmgmolecule","hwpang"))
40-
copy!(species,pyimport_conda("molecule.species","rmgmolecule","hwpang"))
41-
copy!(reaction,pyimport_conda("molecule.reaction","rmgmolecule","hwpang"))
42-
copy!(nasa,pyimport_conda("molecule.thermo.nasa","rmgmolecule","hwpang"))
43-
copy!(wilhoit,pyimport_conda("molecule.thermo.wilhoit","rmgmolecule","hwpang"))
44-
copy!(arrhenius,pyimport_conda("molecule.kinetics.arrhenius","rmgmolecule","hwpang"))
45-
copy!(falloff,pyimport_conda("molecule.kinetics.falloff","rmgmolecule","hwpang"))
46-
copy!(chebyshev,pyimport_conda("molecule.kinetics.chebyshev","rmgmolecule","hwpang"))
47-
copy!(solvation,pyimport_conda("molecule.data.solvation","rmgmolecule","hwpang"))
48-
copy!(fragment,pyimport_conda("molecule.molecule.fragment","rmgmolecule","hwpang"))
49-
end
50-
copy!(pydot,pyimport_conda("pydot","pydot"))
51-
copy!(os,pyimport_conda("os","os"))
4+
using PythonCall
5+
pyimport("sys").path.append("")
6+
function __init__()
7+
Chem = @pyconst(pyimport("rdkit.Chem"))
8+
Desc = @pyconst(pyimport("rdkit.Chem.Descriptors"))
9+
try
10+
molecule = @pyconst(pyimport("rmgpy.molecule"))
11+
chemkin = @pyconst(pyimport("rmgpy.chemkin"))
12+
species = @pyconst(pyimport("rmgpy.species"))
13+
reaction = @pyconst(pyimport("rmgpy.reaction"))
14+
nasa = @pyconst(pyimport("rmgpy.thermo.nasa"))
15+
wilhoit = @pyconst(pyimport("rmgpy.thermo.wilhoit"))
16+
arrhenius = @pyconst(pyimport("rmgpy.kinetics.arrhenius"))
17+
falloff = @pyconst(pyimport("rmgpy.kinetics.falloff"))
18+
chebyshev = @pyconst(pyimport("rmgpy.kinetics.chebyshev"))
19+
solvation = @pyconst(pyimport("rmgpy.data.solvation"))
20+
fragment = @pyconst(pyimport("rmgpy.molecule.fragment"))
21+
catch e
22+
molecule = @pyconst(pyimport("molecule.molecule"))
23+
chemkin = @pyconst(pyimport("molecule.chemkin"))
24+
species = @pyconst(pyimport("molecule.species"))
25+
reaction = @pyconst(pyimport("molecule.reaction"))
26+
nasa = @pyconst(pyimport("molecule.thermo.nasa"))
27+
wilhoit = @pyconst(pyimport("molecule.thermo.wilhoit"))
28+
arrhenius = @pyconst(pyimport("molecule.kinetics.arrhenius"))
29+
falloff = @pyconst(pyimport("molecule.kinetics.falloff"))
30+
chebyshev = @pyconst(pyimport("molecule.kinetics.chebyshev"))
31+
solvation = @pyconst(pyimport("molecule.data.solvation"))
32+
fragment = @pyconst(pyimport("molecule.molecule.fragment"))
5233
end
53-
include("Constants.jl")
54-
include("Tools.jl")
55-
include("Calculators/RateUncertainty.jl")
56-
include("Calculators/ThermoUncertainty.jl")
57-
include("Calculators/Thermo.jl")
58-
include("Calculators/Diffusion.jl")
59-
include("Calculators/Rate.jl")
60-
include("Calculators/Viscosity.jl")
61-
include("Calculators/Thermovec.jl")
62-
include("Calculators/Ratevec.jl")
63-
include("Calculators/kLAkH.jl")
64-
include("Species.jl")
65-
include("Solvent.jl")
66-
include("Reaction.jl")
67-
include("Phase.jl")
68-
include("PhaseState.jl")
69-
include("Interface.jl")
70-
include("Domain.jl")
71-
include("yml.jl")
72-
include("Parse.jl")
73-
include("ModelReduction.jl")
74-
include("Reactor.jl")
75-
include("ThreadedSensitivities.jl")
76-
include("Simulation.jl")
77-
include("TransitorySensitivities.jl")
78-
include("AutomaticMechanismAnalysis.jl")
79-
include("EdgeAnalysis.jl")
80-
include("Debugging.jl")
81-
include("Plotting.jl")
82-
include("fluxdiagrams.jl")
34+
pydot = @pyconst(pyimport("pydot"))
35+
os = @pyconst(pyimport("os"))
36+
end
37+
include("Constants.jl")
38+
include("Tools.jl")
39+
include("Calculators/RateUncertainty.jl")
40+
include("Calculators/ThermoUncertainty.jl")
41+
include("Calculators/Thermo.jl")
42+
include("Calculators/Diffusion.jl")
43+
include("Calculators/Rate.jl")
44+
include("Calculators/Viscosity.jl")
45+
include("Calculators/Thermovec.jl")
46+
include("Calculators/Ratevec.jl")
47+
include("Calculators/kLAkH.jl")
48+
include("Species.jl")
49+
include("Solvent.jl")
50+
include("Reaction.jl")
51+
include("Phase.jl")
52+
include("PhaseState.jl")
53+
include("Interface.jl")
54+
include("Domain.jl")
55+
include("yml.jl")
56+
include("Parse.jl")
57+
include("ModelReduction.jl")
58+
include("Reactor.jl")
59+
include("ThreadedSensitivities.jl")
60+
include("Simulation.jl")
61+
include("TransitorySensitivities.jl")
62+
include("AutomaticMechanismAnalysis.jl")
63+
include("EdgeAnalysis.jl")
64+
include("Debugging.jl")
65+
include("Plotting.jl")
66+
include("fluxdiagrams.jl")
8367
end

0 commit comments

Comments
 (0)