Skip to content

Commit 1997ef9

Browse files
committed
debug
1 parent e68d462 commit 1997ef9

23 files changed

+92
-152
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/Install.yml

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

.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 & 6 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"
@@ -43,7 +43,7 @@ YAML = "ddb6d928-2868-570f-bddf-ab3f9cf99eb6"
4343
[compat]
4444
Calculus = "0.4,0.5"
4545
Colors = "0.11,0.12"
46-
Conda = "1"
46+
CondaPkg = "0"
4747
CSV = "0.10"
4848
DataFrames = "1"
4949
SciMLSensitivity = "^7"
@@ -57,8 +57,8 @@ ModelingToolkit = "8"
5757
OrdinaryDiffEq = "^6"
5858
Parameters = "0.12"
5959
PreallocationTools = "0.4"
60-
PyCall = "1"
61-
PyPlot = "2"
60+
PythonCall = "0"
61+
PythonPlot = "1"
6262
QuartzImageIO = "0.7"
6363
RecursiveArrayTools = "2.17"
6464
ReverseDiff = "1.9"

deps/build.jl

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +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 in [7, 8, 9]))
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.add("python=3.8")
7-
try
8-
Conda.rm("numpy") #get around MKL problem
9-
catch e
10-
end
11-
Conda.add("nomkl")
12-
Conda.add("numpy")
13-
Conda.add_channel("mjohnson541")
14-
Conda.add("rmgmolecule")
15-
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")
1612
end

docs/src/Installation.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ The above instructions will automatically handle Julia-Python linking. However,
3737

3838
```
3939
import Pkg
40-
Pkg.add("PyCall")
40+
Pkg.add("PythonCall")
4141
ENV["CONDA_JL_HOME"] = PATH_TO_YOUR_ENV
42-
Pkg.build("Conda")
42+
Pkg.build("CondaPkg")
4343
ENV["PYTHON"] = PATH_TO_PYTHON
44-
Pkg.build("PyCall")
44+
Pkg.build("PythonCall")
4545
```

environment.yml

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

iJulia/Automatic Mechanism Analysis Example.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"outputs": [],
99
"source": [
1010
"using Sundials\n",
11-
"using PyPlot\n",
11+
"using PythonPlot\n",
1212
"using ReactionMechanismSimulator"
1313
]
1414
},

iJulia/ConstantPH2Combustion.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"outputs": [],
3030
"source": [
3131
"using DifferentialEquations\n",
32-
"using PyPlot\n",
32+
"using PythonPlot\n",
3333
"using ReactionMechanismSimulator"
3434
]
3535
},

iJulia/ConstantTPH2Combustion.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"using DiffEqBase\n",
1010
"using Sundials\n",
1111
"using DiffEqSensitivity\n",
12-
"using PyPlot\n",
12+
"using PythonPlot\n",
1313
"using ReactionMechanismSimulator"
1414
]
1515
},

iJulia/ConstantTVOctaneOxidation.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"outputs": [],
88
"source": [
99
"using DifferentialEquations\n",
10-
"using PyPlot\n",
10+
"using PythonPlot\n",
1111
"using ReactionMechanismSimulator"
1212
]
1313
},

iJulia/ConstantVH2Combustion.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"outputs": [],
88
"source": [
99
"using DifferentialEquations\n",
10-
"using PyPlot\n",
10+
"using PythonPlot\n",
1111
"using ReactionMechanismSimulator"
1212
]
1313
},

iJulia/Gas-Catalyst Interface.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"outputs": [],
88
"source": [
99
"using ReactionMechanismSimulator\n",
10-
"using PyPlot\n",
10+
"using PythonPlot\n",
1111
"using DifferentialEquations\n",
1212
"using Sundials"
1313
]

iJulia/ParametrizedTConstantVOctaneOxidation.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"outputs": [],
88
"source": [
99
"using DifferentialEquations\n",
10-
"using PyPlot\n",
10+
"using PythonPlot\n",
1111
"using ReactionMechanismSimulator"
1212
]
1313
},

iJulia/ParametrizedTPH2Combustion.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"outputs": [],
88
"source": [
99
"using DifferentialEquations\n",
10-
"using PyPlot\n",
10+
"using PythonPlot\n",
1111
"using ReactionMechanismSimulator"
1212
]
1313
},

iJulia/ParametrizedVH2Combustion.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"outputs": [],
88
"source": [
99
"using DifferentialEquations\n",
10-
"using PyPlot\n",
10+
"using PythonPlot\n",
1111
"using ReactionMechanismSimulator"
1212
]
1313
},

iJulia/Quasi-Steady State Assumptions and Isomer Lumping.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"source": [
1010
"using ReactionMechanismSimulator\n",
1111
"using ReactionMechanismSimulator.Sundials\n",
12-
"using ReactionMechanismSimulator.PyPlot"
12+
"using ReactionMechanismSimulator.PythonPlot"
1313
]
1414
},
1515
{

iJulia/Vapor-Liquid Two-Phase Low-Temperature Pyrolysis.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1429,7 +1429,7 @@
14291429
"source": [
14301430
"using ReactionMechanismSimulator\n",
14311431
"using ReactionMechanismSimulator.Sundials\n",
1432-
"using ReactionMechanismSimulator.PyPlot"
1432+
"using ReactionMechanismSimulator.PythonPlot"
14331433
]
14341434
},
14351435
{

src/Parse.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using Unitful
22
using YAML
3-
using PyCall
3+
using PythonCall
44
using StaticArrays
55

66
module Calc

src/Plotting.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using PyPlot
1+
using PythonPlot
22

33
"""
44
Plot the mole fractions of the simulation bsol from t0 to tf
@@ -484,7 +484,7 @@ function plottimescales(Jy;taumax=1e6,taumin=1e-18,taures=10.0^0.5,usediag=true)
484484
else
485485
taus = 1.0./abs.(eigvals(Jy))
486486
end
487-
PyPlot.hist([x==Inf ? 0.0 : x for x in taus],bins=10.0.^(log10(taumin):log10(taures):log10(taumax)))
487+
PythonPlot.hist([x == Inf ? 0.0 : x for x in taus], bins=10.0 .^ (log10(taumin):log10(taures):log10(taumax)))
488488
xscale("log")
489489
xlabel("Species Time Scale [sec]")
490490
ylabel("Counts")

src/ReactionMechanismSimulator.jl

Lines changed: 44 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,53 @@
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()
4+
using PythonCall
5+
pyimport("sys").path.append("")
6+
const Chem = Ref{Py}()
7+
const Desc = Ref{Py}()
8+
const molecule = Ref{Py}()
9+
const chemkin = Ref{Py}()
10+
const species = Ref{Py}()
11+
const reaction = Ref{Py}()
12+
const nasa = Ref{Py}()
13+
const wilhoit = Ref{Py}()
14+
const arrhenius = Ref{Py}()
15+
const falloff = Ref{Py}()
16+
const chebyshev = Ref{Py}()
17+
const solvation = Ref{Py}()
18+
const fragment = Ref{Py}()
19+
const pydot = Ref{Py}()
20+
const os = Ref{Py}()
2221
function __init__()
23-
copy!(Chem, pyimport_conda("rdkit.Chem", "rdkit", "rmg"))
24-
copy!(Desc, pyimport_conda("rdkit.Chem.Descriptors", "rdkit", "rmg"))
22+
Chem[] = pyimport("rdkit.Chem")
23+
Desc[] = pyimport("rdkit.Chem.Descriptors")
2524
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"))
25+
molecule[] = pyimport("rmgpy.molecule")
26+
chemkin[] = pyimport("rmgpy.chemkin")
27+
species[] = pyimport("rmgpy.species")
28+
reaction[] = pyimport("rmgpy.reaction")
29+
nasa[] = pyimport("rmgpy.thermo.nasa")
30+
wilhoit[] = pyimport("rmgpy.thermo.wilhoit")
31+
arrhenius[] = pyimport("rmgpy.kinetics.arrhenius")
32+
falloff[] = pyimport("rmgpy.kinetics.falloff")
33+
chebyshev[] = pyimport("rmgpy.kinetics.chebyshev")
34+
solvation[] = pyimport("rmgpy.data.solvation")
35+
fragment[] = pyimport("rmgpy.molecule.fragment")
3736
catch e
38-
copy!(molecule, pyimport_conda("molecule.molecule", "rmgmolecule", "mjohnson541"))
39-
copy!(chemkin, pyimport_conda("molecule.chemkin", "rmgmolecule", "mjohnson541"))
40-
copy!(species, pyimport_conda("molecule.species", "rmgmolecule", "mjohnson541"))
41-
copy!(reaction, pyimport_conda("molecule.reaction", "rmgmolecule", "mjohnson541"))
42-
copy!(nasa, pyimport_conda("molecule.thermo.nasa", "rmgmolecule", "mjohnson541"))
43-
copy!(wilhoit, pyimport_conda("molecule.thermo.wilhoit", "rmgmolecule", "mjohnson541"))
44-
copy!(arrhenius, pyimport_conda("molecule.kinetics.arrhenius", "rmgmolecule", "mjohnson541"))
45-
copy!(falloff, pyimport_conda("molecule.kinetics.falloff", "rmgmolecule", "mjohnson541"))
46-
copy!(chebyshev, pyimport_conda("molecule.kinetics.chebyshev", "rmgmolecule", "mjohnson541"))
47-
copy!(solvation, pyimport_conda("molecule.data.solvation", "rmgmolecule", "mjohnson541"))
48-
copy!(fragment, pyimport_conda("molecule.molecule.fragment", "rmgmolecule", "mjohnson541"))
37+
molecule[] = pyimport("molecule.molecule")
38+
chemkin[] = pyimport("molecule.chemkin")
39+
species[] = pyimport("molecule.species")
40+
reaction[] = pyimport("molecule.reaction")
41+
nasa[] = pyimport("molecule.thermo.nasa")
42+
wilhoit[] = pyimport("molecule.thermo.wilhoit")
43+
arrhenius[] = pyimport("molecule.kinetics.arrhenius")
44+
falloff[] = pyimport("molecule.kinetics.falloff")
45+
chebyshev[] = pyimport("molecule.kinetics.chebyshev")
46+
solvation[] = pyimport("molecule.data.solvation")
47+
fragment[] = pyimport("molecule.molecule.fragment")
4948
end
50-
copy!(pydot, pyimport_conda("pydot", "pydot"))
51-
copy!(os, pyimport_conda("os", "os"))
49+
pydot[] = pyimport("pydot")
50+
os[] = pyimport("os")
5251
end
5352
include("Constants.jl")
5453
include("Tools.jl")

0 commit comments

Comments
 (0)