Skip to content

update cantera version to remove need for x86 emulation on arm mac #2751

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 27 commits into
base: feat/py39_rebase
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
0e2f7f2
HWP Initial JuliaCall efforts
hwpang Mar 22, 2024
a40cd0a
JWB initial increase to Python 3.9
JacksonBurns Jun 27, 2024
15c2828
make muq optional (like the docs say!) and add a helpful msg if missing
JacksonBurns Jul 1, 2024
df00e0c
fix cython compilation errors (0.23 -> 3.n), SEE EXTENDED!!
JacksonBurns Jul 1, 2024
9f854ca
add newly defined functions to `pxd` files
JacksonBurns Jul 1, 2024
363b0dc
HWP Additional JulicaCall Debugging
hwpang Jul 2, 2024
e3a8bed
XD Initial MILP Re-implementation
xiaoruiDong Mar 5, 2024
26f3d1f
HWP Isodesmic Improvements
hwpang Jan 24, 2024
d758ef0
JWB Python 3.9 and Cython Debugging, Optional RMS, fix Clar
JacksonBurns Dec 3, 2024
a9b56b3
dont install juliacall by default
JacksonBurns Dec 3, 2024
1530ada
np.bool is deprecated, bool
JacksonBurns Dec 3, 2024
0fa7895
re-bury the julia imports that got shuffled around
JacksonBurns Dec 3, 2024
2b27f4b
remove initial species add - was carried over by accident during deve…
JacksonBurns Dec 3, 2024
0a13902
fix call to `get_reaction_matches` (should match other test)
JacksonBurns Jan 14, 2025
b774dec
make the m1 mac run in x86 compat mode
JacksonBurns Jan 14, 2025
24f140f
split the python-only test into separate CI to simplify reg test logic
JacksonBurns Jan 14, 2025
a7730a6
fix `juliacall` incompatibilities; see extended
JacksonBurns Jan 25, 2025
0e33bf3
docker build should wait for regression test
JacksonBurns Jan 25, 2025
80bb62f
change liquid initial conditions to surface initial conditions for Co…
jonwzheng Jan 27, 2025
5c549e0
run build-and-test on ARM Mac natively
JacksonBurns Jan 26, 2025
343b65a
cantera 3 updates
JacksonBurns Jan 26, 2025
1ef5f94
collider is never None - must change test (See ext)
JacksonBurns Jan 27, 2025
8464e20
efficiencies attribute has moved
JacksonBurns Jan 28, 2025
f8819ef
no space between SITE and SDEN
JacksonBurns Jan 28, 2025
39f3124
exactly one space (?)
JacksonBurns Jan 28, 2025
bee42fa
sit emust have name, cantera 3 bug
JacksonBurns Jan 28, 2025
ea0b252
possible workaround
JacksonBurns Jan 29, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .conda/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ requirements:
- {{ compiler('c') }} # [unix]
host:
- cython >=0.25.2
- lpsolve55
- numpy
- openbabel >=3
- pydas >=1.0.2
Expand All @@ -39,7 +38,6 @@ requirements:
- h5py
- jinja2
- jupyter
- lpsolve55
- markupsafe
- matplotlib >=1.5
- mopac
Expand Down
168 changes: 92 additions & 76 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ on:
schedule:
# * is a special character in YAML so you have to quote this string
- cron: "0 8 * * *"
# runs on all branches on both RMG-Py and forks
push:
# allow running on RMG-Py on a pushed branch, only if triggered manually
workflow_dispatch:
# runs on PRs against RMG-Py (and anywhere else, but we add this for RMG-Py)
pull_request:

Expand All @@ -49,10 +49,19 @@ env:
# main with the name of the branch
RMG_DATABASE_BRANCH: main


jobs:
build-osx:
runs-on: macos-13
build-and-test:
strategy:
fail-fast: false
matrix:
python-version: ["3.9"]
os: [macos-13, macos-latest, ubuntu-latest]
include-rms: ["", "with RMS"]
exclude:
- os: macos-13 # GitHub's runners just aren't up to the task of installing Julia
include-rms: 'with RMS'
runs-on: ${{ matrix.os }}
name: Python ${{ matrix.python-version }} ${{ matrix.os }} Build and Test ${{ matrix.include-rms }}
# skip scheduled runs from forks
if: ${{ !( github.repository != 'ReactionMechanismGenerator/RMG-Py' && github.event_name == 'schedule' ) }}
defaults:
Expand All @@ -62,55 +71,71 @@ jobs:
- name: Checkout RMG-Py
uses: actions/checkout@v4

# Step to create a custom condarc.yml before setting up conda
- name: Create custom conda config file
run: |
RUNNER_CWD=$(pwd)
echo "channels:" > $RUNNER_CWD/condarc.yml
echo " - conda-forge" >> $RUNNER_CWD/condarc.yml
echo " - rmg" >> $RUNNER_CWD/condarc.yml
echo " - cantera" >> $RUNNER_CWD/condarc.yml
echo "show_channel_urls: true" >> $RUNNER_CWD/condarc.yml

# configures the mamba environment manager and builds the environment
- name: Setup Miniforge Python 3.7
- name: Setup Miniforge Python ${{ matrix.python-version }}
uses: conda-incubator/setup-miniconda@v3
with:
environment-file: environment.yml
miniforge-variant: Miniforge3
miniforge-version: latest
python-version: 3.7
condarc-file: condarc.yml
python-version: ${{ matrix.python-version }}
activate-environment: rmg_env
use-mamba: true
auto-update-conda: true
show-channel-urls: true
channels: conda-forge,cantera,rmg
conda-remove-defaults: "true"

# list the environment for debugging purposes
- name: mamba info
- name: conda info
run: |
mamba info
mamba list
conda info
conda list

# Clone RMG-database
- name: Clone RMG-database
run: |
cd ..
git clone -b $RMG_DATABASE_BRANCH https://github.com/ReactionMechanismGenerator/RMG-database.git

# modify env variables as directed in the RMG installation instructions
- name: Set Environment Variables
# RMG build step
- run: make install

- name: Setup Juliaup
if: matrix.include-rms == 'with RMS'
uses: julia-actions/install-juliaup@v2
with:
channel: '1.9'

- name: Set some env vars
if: matrix.include-rms == 'with RMS'
run: |
RUNNER_CWD=$(pwd)
echo "PYTHONPATH=$RUNNER_CWD/RMG-Py:$PYTHONPATH" >> $GITHUB_ENV
echo "$RUNNER_CWD/RMG-Py" >> $GITHUB_PATH
# https://juliapy.github.io/PythonCall.jl/stable/pythoncall/#If-you-already-have-Python-and-required-Python-packages-installed
echo "JULIA_CONDAPKG_BACKEND=Null" >> $GITHUB_ENV
echo "JULIA_PYTHONCALL_EXE=$CONDA_PREFIX/bin/python" >> $GITHUB_ENV

# RMG build step
- name: make RMG
# RMS installation and linking to Julia
- name: Install and link Julia dependencies
if: matrix.include-rms == 'with RMS'
timeout-minutes: 120 # this usually takes 20-45 minutes (or hangs for 6+ hours).
run: . install_rms.sh

- name: Set some other env vars
if: matrix.include-rms == 'with RMS'
run: |
make clean
make
# ensure that juliacall in Python uses the correct julia executable and packages: https://github.com/JuliaPy/PyJuliaPkg?tab=readme-ov-file#which-julia-gets-used
echo "PYTHON_JULIAPKG_EXE=$(which julia)" >> $GITHUB_ENV
echo "PYTHON_JULIAPKG_PROJECT=$HOME/.julia/packages" >> $GITHUB_ENV

- name: Install Q2DTor
run: echo "" | make q2dtor

build-and-test-linux:
# non-regression testing
- name: Run Unit, Functional, and Database Tests
run: make test-all

regression-test:
needs: build-and-test
runs-on: ubuntu-latest
name: Regression Test
# skip scheduled runs from forks
if: ${{ !( github.repository != 'ReactionMechanismGenerator/RMG-Py' && github.event_name == 'schedule' ) }}
env:
Expand All @@ -123,76 +148,67 @@ jobs:
- name: Checkout RMG-Py
uses: actions/checkout@v4

# Step to create a custom condarc.yml before setting up conda
- name: Create custom condarc.yml
run: |
RUNNER_CWD=$(pwd)
echo "channels:" > $RUNNER_CWD/condarc.yml
echo " - conda-forge" >> $RUNNER_CWD/condarc.yml
echo " - rmg" >> $RUNNER_CWD/condarc.yml
echo " - cantera" >> $RUNNER_CWD/condarc.yml
echo "show_channel_urls: true" >> $RUNNER_CWD/condarc.yml

# configures the mamba environment manager and builds the environment
- name: Setup Miniforge Python 3.7
- name: Setup Miniforge Python 3.9
uses: conda-incubator/setup-miniconda@v3
with:
environment-file: environment.yml
miniforge-variant: Miniforge3
miniforge-version: latest
python-version: 3.7
condarc-file: condarc.yml
python-version: 3.9
activate-environment: rmg_env
use-mamba: true
auto-update-conda: true
show-channel-urls: true
channels: conda-forge,cantera,rmg
conda-remove-defaults: "true"

# list the environment for debugging purposes
- name: mamba info
- name: conda info
run: |
mamba info
mamba list
conda info
conda list

# Clone RMG-database
- name: Clone RMG-database
run: |
cd ..
git clone -b $RMG_DATABASE_BRANCH https://github.com/ReactionMechanismGenerator/RMG-database.git

# modify env variables as directed in the RMG installation instructions
- name: Set Environment Variables
run: |
RUNNER_CWD=$(pwd)
echo "PYTHONPATH=$RUNNER_CWD/RMG-Py:$PYTHONPATH" >> $GITHUB_ENV
echo "$RUNNER_CWD/RMG-Py" >> $GITHUB_PATH

# RMG build step
- name: make RMG
- run: make install

- name: Setup Juliaup
uses: julia-actions/install-juliaup@v2
with:
channel: '1.9'

- name: Set some env vars
run: |
make clean
make
# https://juliapy.github.io/PythonCall.jl/stable/pythoncall/#If-you-already-have-Python-and-required-Python-packages-installed
echo "JULIA_CONDAPKG_BACKEND=Null" >> $GITHUB_ENV
echo "JULIA_PYTHONCALL_EXE=$CONDA_PREFIX/bin/python" >> $GITHUB_ENV

# RMS installation and linking to Julia
- name: Install and link Julia dependencies
timeout-minutes: 120 # this usually takes 20-45 minutes (or hangs for 6+ hours).
run: . install_rms.sh

- name: Set some other env vars
run: |
python -c "import julia; julia.install(); import diffeqpy; diffeqpy.install()"
julia -e 'using Pkg; Pkg.add(PackageSpec(name="ReactionMechanismSimulator",rev="for_rmg")); using ReactionMechanismSimulator'
# ensure that juliacall in Python uses the correct julia executable and packages: https://github.com/JuliaPy/PyJuliaPkg?tab=readme-ov-file#which-julia-gets-used
echo "PYTHON_JULIAPKG_EXE=$(which julia)" >> $GITHUB_ENV
echo "PYTHON_JULIAPKG_PROJECT=$HOME/.julia/packages" >> $GITHUB_ENV

- name: Install Q2DTor
run: echo "" | make q2dtor

# non-regression testing
- name: Run Unit, Functional, and Database Tests
# aggregate into one command so we only have to eat the collection time once
run: make test-all

# Regression Testing - Test Execution
- name: Regression Tests - Execution
id: regression-execution
timeout-minutes: 60
run: |
for regr_test in aromatics liquid_oxidation nitrogen oxidation sulfur superminimal RMS_constantVIdealGasReactor_superminimal RMS_CSTR_liquid_oxidation RMS_liquidSurface_ch4o2cat fragment RMS_constantVIdealGasReactor_fragment minimal_surface;
do
if python-jl rmg.py test/regression/"$regr_test"/input.py; then
if python rmg.py test/regression/"$regr_test"/input.py; then
echo "$regr_test" "Executed Successfully"
else
echo "$regr_test" "Failed to Execute" | tee -a $GITHUB_STEP_SUMMARY
Expand Down Expand Up @@ -282,7 +298,7 @@ jobs:

echo "<details>"
# Compare the edge and core
if python-jl scripts/checkModels.py \
if python scripts/checkModels.py \
"$regr_test-core" \
$REFERENCE/"$regr_test"/chemkin/chem_annotated.inp \
$REFERENCE/"$regr_test"/chemkin/species_dictionary.txt \
Expand All @@ -299,7 +315,7 @@ jobs:
cat "$regr_test-core.log" || (echo "Dumping the whole log failed, please download it from GitHub actions. Here are the first 100 lines:" && head -n100 "$regr_test-core.log")
echo "</details>"
echo "<details>"
if python-jl scripts/checkModels.py \
if python scripts/checkModels.py \
"$regr_test-edge" \
$REFERENCE/"$regr_test"/chemkin/chem_edge_annotated.inp \
$REFERENCE/"$regr_test"/chemkin/species_edge_dictionary.txt \
Expand All @@ -320,7 +336,7 @@ jobs:
if [ -f test/regression/"$regr_test"/regression_input.py ];
then
echo "<details>"
if python-jl rmgpy/tools/regression.py \
if python rmgpy/tools/regression.py \
test/regression/"$regr_test"/regression_input.py \
$REFERENCE/"$regr_test"/chemkin \
test/regression/"$regr_test"/chemkin
Expand Down Expand Up @@ -357,14 +373,14 @@ jobs:

- name: Upload regression summary artifact
# the annotate workflow uses this artifact to add a comment to the PR
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if : ${{ github.event_name == 'pull_request' }}
with:
name: regression_summary
path: summary.txt

- name: Upload Comparison Results
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: regression_test_comparison_results
path: |
Expand All @@ -374,7 +390,7 @@ jobs:
- name: Code coverage install and run
if: success() || ( failure() && steps.regression-execution.conclusion == 'success' )
run: |
mamba install -y -c conda-forge codecov
conda install -y -c conda-forge codecov
codecov

build-and-push-docker:
Expand All @@ -384,7 +400,7 @@ jobs:
# who knows ¯\_(ツ)_/¯
#
# taken from https://github.com/docker/build-push-action
needs: build-and-test-linux
needs: regression-test
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' && github.repository == 'ReactionMechanismGenerator/RMG-Py'
steps:
Expand Down
12 changes: 4 additions & 8 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,17 @@ jobs:
with:
fetch-depth: 0

- name: Setup Mambaforge Python 3.7
- name: Setup Miniforge Python 3.9
uses: conda-incubator/setup-miniconda@v3
with:
environment-file: environment.yml
miniforge-variant: Miniforge3
miniforge-version: latest
python-version: 3.7
python-version: 3.9
activate-environment: rmg_env
use-mamba: true
show-channel-urls: true
channels: conda-forge,cantera,rmg

- name: Install sphinx
run: mamba install -y sphinx
Expand All @@ -60,12 +62,6 @@ jobs:
make clean
make

- name: Install and link Julia dependencies
timeout-minutes: 120 # this usually takes 20-45 minutes (or hangs for 6+ hours).
run: |
python -c "import julia; julia.install(); import diffeqpy; diffeqpy.install()"
julia -e 'using Pkg; Pkg.add(PackageSpec(name="ReactionMechanismSimulator",rev="for_rmg")); using ReactionMechanismSimulator'

- name: Checkout gh-pages Branch
uses: actions/checkout@v2
with:
Expand Down
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,18 @@
#
################################################################################

# build dir
reactionmechanismgenerator.egg-info/

# MacOS files
.DS_Store

# Compiled Python modules
*.pyc
*.so
*.pyd
# and intermediate source files
*.c

# Image files generated by RMG
*.png
Expand Down Expand Up @@ -47,7 +52,7 @@ nbproject/*
.vscode/*

# Unit test files
.coverage
.coverage*
testing/*
htmlcov/*

Expand Down Expand Up @@ -103,6 +108,7 @@ test/rmgpy/test_data/temp_dir_for_testing/cantera/chem001.yaml
rmgpy/test_data/copied_kinetic_lib/
testing/qm/*
test_log.txt
rmgpy/tools/data/flux/flux/1/*.dot

# example directory - save the inputs but not the outputs
# cantera input files
Expand All @@ -117,3 +123,4 @@ examples/**/dictionary.txt
examples/**/reactions.py
examples/**/RMG_libraries
examples/**/species
examples/**/plots
Loading
Loading