Skip to content

Commit 60c4125

Browse files
committed
misc. small fixes from debugging and review
- hide some pointless output in a dropdown in the regression tests - move RMS into its own conda env to avoid Sundials breaking for Cantera - further limit size of surface RMS mechanism to avoid memory error - explicitly pass linear solver to CVODE to avoid it not being initializated - a typo fix - setuptools and cython version limtiations
1 parent f05b983 commit 60c4125

File tree

7 files changed

+37
-16
lines changed

7 files changed

+37
-16
lines changed

.github/workflows/CI.yml

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ env:
4848
# if running on RMG-Py but requiring changes on an un-merged branch of RMG-database, replace
4949
# main with the name of the branch
5050
RMG_DATABASE_BRANCH: main
51+
# julia parallel pre-compilation leads to race conditions and hangs, so we limit it to run in serial
52+
JULIA_NUM_PRECOMPILE_TASKS: 1
5153

5254
jobs:
5355
build-and-test:
@@ -102,7 +104,7 @@ jobs:
102104
if: matrix.include-rms == 'with RMS'
103105
uses: julia-actions/install-juliaup@v2
104106
with:
105-
channel: '1.9'
107+
channel: '1.10'
106108

107109
- name: Set some env vars
108110
if: matrix.include-rms == 'with RMS'
@@ -173,25 +175,33 @@ jobs:
173175
174176
# RMG build step
175177
- run: make install
178+
179+
- name: Make separate RMS conda env
180+
run: |
181+
conda create --name rmg_env_with_rms --clone rmg_env
176182
177183
- name: Setup Juliaup
178184
uses: julia-actions/install-juliaup@v2
179185
with:
180-
channel: '1.9'
186+
channel: '1.10'
181187

182188
- name: Set some env vars
183189
run: |
190+
conda activate rmg_env_with_rms
184191
# https://juliapy.github.io/PythonCall.jl/stable/pythoncall/#If-you-already-have-Python-and-required-Python-packages-installed
185192
echo "JULIA_CONDAPKG_BACKEND=Null" >> $GITHUB_ENV
186193
echo "JULIA_PYTHONCALL_EXE=$CONDA_PREFIX/bin/python" >> $GITHUB_ENV
187194
188195
# RMS installation and linking to Julia
189196
- name: Install and link Julia dependencies
190197
timeout-minutes: 120 # this usually takes 20-45 minutes (or hangs for 6+ hours).
191-
run: . install_rms.sh
198+
run: |
199+
conda activate rmg_env_with_rms
200+
. install_rms.sh
192201
193202
- name: Set some other env vars
194203
run: |
204+
conda activate rmg_env_with_rms
195205
# 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
196206
echo "PYTHON_JULIAPKG_EXE=$(which julia)" >> $GITHUB_ENV
197207
echo "PYTHON_JULIAPKG_PROJECT=$HOME/.julia/packages" >> $GITHUB_ENV
@@ -202,8 +212,8 @@ jobs:
202212
# Regression Testing - Test Execution
203213
- name: Regression Tests - Execution
204214
id: regression-execution
205-
timeout-minutes: 60
206215
run: |
216+
conda activate rmg_env_with_rms
207217
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;
208218
do
209219
if python rmg.py test/regression/"$regr_test"/input.py; then
@@ -278,7 +288,11 @@ jobs:
278288
env:
279289
REFERENCE: stable_regression_results
280290
run: |
291+
# we _do not_ run in the with_rms env here
292+
# conda activate rmg_env_with_rms
293+
281294
exec 2> >(tee -a regression.stderr >&2) 1> >(tee -a regression.stdout)
295+
touch checkModels.log
282296
mkdir -p "test/regression-diff"
283297
for regr_test in aromatics liquid_oxidation nitrogen oxidation sulfur superminimal RMS_constantVIdealGasReactor_superminimal RMS_CSTR_liquid_oxidation fragment RMS_constantVIdealGasReactor_fragment minimal_surface;
284298
do
@@ -301,7 +315,7 @@ jobs:
301315
$REFERENCE/"$regr_test"/chemkin/chem_annotated.inp \
302316
$REFERENCE/"$regr_test"/chemkin/species_dictionary.txt \
303317
test/regression/"$regr_test"/chemkin/chem_annotated.inp \
304-
test/regression/"$regr_test"/chemkin/species_dictionary.txt
318+
test/regression/"$regr_test"/chemkin/species_dictionary.txt &> checkModels.log
305319
then
306320
echo "<summary>$regr_test Passed Core Comparison ✅</summary>"
307321
else
@@ -318,7 +332,7 @@ jobs:
318332
$REFERENCE/"$regr_test"/chemkin/chem_edge_annotated.inp \
319333
$REFERENCE/"$regr_test"/chemkin/species_edge_dictionary.txt \
320334
test/regression/"$regr_test"/chemkin/chem_edge_annotated.inp \
321-
test/regression/"$regr_test"/chemkin/species_edge_dictionary.txt
335+
test/regression/"$regr_test"/chemkin/species_edge_dictionary.txt &> checkModels.log
322336
then
323337
echo "<summary>$regr_test Passed Edge Comparison ✅</summary>"
324338
else
@@ -337,7 +351,7 @@ jobs:
337351
if python rmgpy/tools/regression.py \
338352
test/regression/"$regr_test"/regression_input.py \
339353
$REFERENCE/"$regr_test"/chemkin \
340-
test/regression/"$regr_test"/chemkin
354+
test/regression/"$regr_test"/chemkin &> checkModels.log
341355
then
342356
echo "<summary>$regr_test Passed Observable Testing ✅</summary>"
343357
else
@@ -366,6 +380,11 @@ jobs:
366380
cat regression.stdout >> summary.txt
367381
echo "</details>" >> summary.txt
368382
echo "" >> summary.txt
383+
echo "<details>" >> summary.txt
384+
echo "<summary>Debugging info for `checkModels.py` (if any).</summary>" >> summary.txt
385+
cat checkModels.log >> summary.txt
386+
echo "</details>" >> summary.txt
387+
echo "" >> summary.txt
369388
echo "_beep boop this comment was written by a bot_ :robot:" >> summary.txt
370389
cat summary.txt > $GITHUB_STEP_SUMMARY
371390

environment.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
# - August 4, 2024 Restricted pyrms to <2
2121
# - May 14, 2024 Removed diffeqpy by switching to call SciMLBase and Sundials using JuliaCall
2222
# - March 15, 2024 - started migration to Python 3.9
23-
# - Mar 11, 2024 Removed Julia dependencies, now considered optional
23+
# - April 14, 2025 Removed Julia dependencies, now considered optional
2424
#
2525
name: rmg_env
2626
channels:
@@ -58,8 +58,9 @@ dependencies:
5858

5959
# Python tools
6060
- conda-forge::python >=3.9 # leave as GEQ so that GitHub actions can add EQ w/o breaking (contradictory deps)
61+
- conda-forge::setuptools <80
6162
- conda-forge::coverage
62-
- conda-forge::cython >=0.25.2
63+
- conda-forge::cython >=0.25.2,<3.1
6364
- conda-forge::scikit-learn
6465
- conda-forge::scipy >=1.9
6566
- conda-forge::numpy >=1.10.0,<2

examples/arkane/networks/acetyl+O2_sls/input.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# Arkane input file for acetyl + O2 pressure-dependent reaction network
44
#
5-
# uses method = 'simulation least squares eigen' for PressureDependence
5+
# uses method = 'simulation least squares' for PressureDependence
66
#
77
################################################################################
88

install_rms.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
# Note that you will have to manually install juliaup before running this script:
66
# curl -fsSL https://install.julialang.org | sh
77
# # restart shell
8-
# juliaup add 1.9
9-
# juliaup default 1.9
8+
# juliaup add 1.10
9+
# juliaup default 1.10
1010
# juliaup remove release
1111

12+
#!/bin/bash
1213

1314
conda install -y conda-forge::pyjuliacall
1415

rmgpy/molecule/group.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
from rmgpy.molecule.fragment import CuttingLabel
4848

4949
# helper functions
50-
# these were originall nested inside the indicated parent function, but when we upgraded to
50+
# these were originally nested inside the indicated parent function, but when we upgraded to
5151
# Cython 3 this was no longer allowed - thus, they now live here.
5252

5353
# add_implicit_benzene

rmgpy/rmg/reactionmechanismsimulator_reactors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ def simulate(self, model_settings, simulator_settings, conditions):
472472
model_settings.tol_rxn_to_core_deadend_radical,
473473
atol=simulator_settings.atol,
474474
rtol=simulator_settings.rtol,
475-
solver=Main.Sundials.CVODE_BDF(),
475+
solver=Main.Sundials.CVODE_BDF(linear_solver=Main.Symbol("GMRES")),
476476
)
477477

478478
return (

test/regression/RMS_liquidSurface_ch4o2cat/input.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,11 @@
7575
toleranceMoveToCore=0.01,
7676
toleranceKeepInEdge=0.001,
7777
toleranceInterruptSimulation=1e8,
78-
maximumEdgeSpecies=10000,
78+
maximumEdgeSpecies=100,
7979
minCoreSizeForPrune=10,
8080
minSpeciesExistIterationsForPrune=2,
8181
maxNumObjsPerIter=3,
82-
maxNumSpecies=35,
82+
maxNumSpecies=10,
8383
)
8484

8585
options(

0 commit comments

Comments
 (0)