Skip to content
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

[Python 3.9] Clar SciPy Re-implementation, pythoncall Debugging, Optional RMS #2694

Draft
wants to merge 153 commits into
base: feat/py39
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
153 commits
Select commit Hold shift + click to select a range
608df00
updating 'rotconsts' ref to be compatible with cclib v1.8+
ChrisBNEU Mar 20, 2024
1123f07
Limit cclib to sub 2 pending large api changes
JacksonBurns Apr 17, 2024
c89bed5
Update rmgpy/qm/molecule.py
ChrisBNEU Apr 17, 2024
925f7d4
Update rmgpy/qm/molecule.py
sevyharris Apr 18, 2024
3b4d926
Update rmgpy/qm/molecule.py
sevyharris Apr 18, 2024
8953732
Update link to cclib documentation
sevyharris Apr 18, 2024
36c84c6
allow versions off cclib after 1.8.0 but before 2
JacksonBurns Apr 19, 2024
c906ddd
fix typos
KnathanM Jun 7, 2024
b5d3040
update environment file, CI, Dockerfile to install optional Julia deps
JacksonBurns Mar 11, 2024
9382ad9
reorder build steps to ensure julia deps are installed in rmg_env
JacksonBurns Mar 11, 2024
4f97ef4
add NO_JULIA and requires_rms throughout
JacksonBurns Jun 12, 2024
6f8780c
bury the import of Julia in Arkane, add helpful error if missing
JacksonBurns Jun 12, 2024
40b368c
point to the installation documentation if user attempts to use RMS -
JacksonBurns Jun 12, 2024
9c8667d
`conda` now uses `libmamba` by default, update docs
JacksonBurns Jun 12, 2024
24a0731
indicate that Julia is optional but recommended, list features
JacksonBurns Jun 12, 2024
dcef9ab
Apply suggestions from code review
JacksonBurns Jun 12, 2024
d541afc
remove unnesecary `NO_JULIA` check
JacksonBurns Jun 12, 2024
d8607f9
import `logging` instead of `warnings`
JacksonBurns Jun 12, 2024
363e2a6
Merge branch 'main' into fix/avoid_unnecessary_julia
JacksonBurns Jun 18, 2024
ade7315
another typo
KnathanM Jun 18, 2024
dc66172
Allow scratch dir as input
hwpang Jul 12, 2024
6285ae6
Use the input scratch dir
hwpang Jul 12, 2024
e07e6af
Refactoring clar optimization and utilize scipy MILP
xiaoruiDong Mar 5, 2024
0f9dcc0
Update pxd of clar optimization after reimplement with scipy MILP
xiaoruiDong Mar 5, 2024
919448b
Remove the redundant ILPSolutionError
xiaoruiDong Mar 5, 2024
517debe
Fix typos in resonance clar optimization
xiaoruiDong Mar 5, 2024
756439f
Fix list style in clar optimization
xiaoruiDong Mar 5, 2024
ca0091a
Update year in license
hwpang Jan 24, 2024
bd60215
imports sorting by formatter
hwpang Jan 24, 2024
d90e4fb
Add improvements by @amarkpayne
hwpang Jan 25, 2024
b78765f
Add constraints for element balance
hwpang Jan 24, 2024
1b052aa
Add pyutilib to catch ApplicationError
hwpang Jan 25, 2024
a929f2c
Formatting by formatter
hwpang Jan 25, 2024
57faf2f
Catch TypeError
hwpang Jan 25, 2024
6938a88
WIP
hwpang Jan 30, 2024
bd7f2b5
Modify based on review comment
hwpang Jun 11, 2024
bbc0030
Better way to initialize empty list
hwpang Jun 11, 2024
7fa4cf1
Improve code readability to get enumerated constraints
hwpang Jun 11, 2024
b28281d
Constraint cation/anion/neutral target to cation/anion/neutral refere…
hwpang Jun 11, 2024
3544b2f
Add warning for easy debugging
hwpang Jun 11, 2024
24bf4e5
Switch to use scipy
hwpang Jun 11, 2024
59e0cf1
Remove unused imports and correct obj fnc
hwpang Jun 11, 2024
fd96df6
Remove unused package, add version constraint to scipy
hwpang Jun 11, 2024
e75c15e
Remove options of solver
hwpang Jun 11, 2024
46e930f
Add comment to make test more readable
hwpang Jun 11, 2024
a61e34b
Use keyword variable
hwpang Jun 11, 2024
05a7d49
Add comment
hwpang Jun 11, 2024
e3cc59e
Add comment to test
hwpang Jun 11, 2024
bb44414
remove lpsolve55 from environments, tests, functions, docstrings, & docs
JacksonBurns Jul 24, 2024
d47a1f5
convert helper function args to kwargs for partial to work, hide func…
JacksonBurns Jul 24, 2024
54efa64
re-try running M1 macs on native hardware rather than x86 emulation
JacksonBurns Jul 24, 2024
12f2968
ugh, typo
JacksonBurns Jul 24, 2024
5407567
pass constraints as a tuple
JacksonBurns Jul 25, 2024
baf260a
fix return type for clar call
JacksonBurns Jul 25, 2024
262ea78
Merge pull request #2691 from hwpang/arkane/scratch
sevyharris Jul 25, 2024
db6e632
update return types in cython header
JacksonBurns Jul 25, 2024
91d74cd
yet more incorrect return types
JacksonBurns Jul 25, 2024
fb19d02
use python warnings module instead of removed numpy warnings passthrough
JacksonBurns Jul 25, 2024
f30b04a
fix incorrect use of `getattr`
JacksonBurns Jul 25, 2024
ff4ef4e
add back the cclib version restriction
JacksonBurns Jul 25, 2024
28d2fbf
allow empty return to be properly excepted
JacksonBurns Jul 25, 2024
be69fb2
fix usage of `n` for iteration
JacksonBurns Jul 25, 2024
5e7b266
make dict_keys -> str conversion explicit so it will run
JacksonBurns Jul 25, 2024
551926d
re-limit the version of cantera to undo the API breaks
JacksonBurns Jul 25, 2024
c1d6902
incorrect placement of parens
JacksonBurns Jul 25, 2024
10e79c2
make tuple cast more explicit
JacksonBurns Jul 26, 2024
8eb302e
add option of drawing reactions with reversible arrow
sevyharris Jul 18, 2024
a4cbbf8
restrict pyrms to <2
mjohnson541 Aug 4, 2024
46b9c92
explicit cast of set to str
JacksonBurns Aug 5, 2024
9092cd5
remove disused pyomo components
JacksonBurns Aug 5, 2024
4f8f268
fix usage of warning
JacksonBurns Aug 5, 2024
56efc1a
Merge pull request #2695 from ReactionMechanismGenerator/feat/isodesm…
JacksonBurns Aug 5, 2024
9efd31c
Merge branch 'main' into fix-doc-typo
jonwzheng Aug 6, 2024
fb8df86
Merge pull request #2670 from KnathanM/fix-doc-typo
jonwzheng Aug 6, 2024
2b4885f
why did we use to do this like this? total bonds = bonds (what bonds?…
JacksonBurns Aug 21, 2024
1b782de
Merge branch 'main' into cclib_rotconsts
JacksonBurns Aug 27, 2024
d6d0182
Merge pull request #2639 from ChrisBNEU/cclib_rotconsts
JacksonBurns Sep 3, 2024
f169ed1
Treat monoatomic molecules correctly in Orca ESS adapter
alongd Aug 19, 2024
9970c1f
Tests: A monoatomic molecule in Orca
alongd Aug 19, 2024
85b9042
Merge pull request #2709 from ReactionMechanismGenerator/orca_monoatomic
JacksonBurns Sep 10, 2024
6a297ec
Parse RS2C (CASPT2) energy in Molpro
alongd Sep 8, 2024
15e6317
Tests: Load RS2C e_elect in Molpro
alongd Sep 8, 2024
d41554a
Don't crush if T1/D1 isn't in the Molpro log file
alongd Jun 23, 2024
2195956
Merge pull request #2711 from ReactionMechanismGenerator/molpro_caspt2
JacksonBurns Sep 11, 2024
136f5d4
remove default channel
mjohnson541 Sep 9, 2024
c5c64e5
Merge pull request #2712 from ReactionMechanismGenerator/test_removin…
JacksonBurns Sep 11, 2024
9473f5e
Revert "temporarily remove `minimal_surface` regression test"
JacksonBurns Jun 9, 2024
721be69
_severely_ limit mechanism size to not crash github actions runners OOM
JacksonBurns Jun 10, 2024
a2e1e60
Merge pull request #2674 from JacksonBurns/ci/minimal_surface
JacksonBurns Sep 16, 2024
692b7bf
CI/doc build uses Miniforge3 instead of Mambaforge
ssun30 Oct 1, 2024
3bb3015
Changed behavior of retrieving regression results
ssun30 Oct 2, 2024
d3f8605
Merge pull request #2718 from ReactionMechanismGenerator/Change_CI_to…
JacksonBurns Oct 2, 2024
3cd15cb
update user and developer installation instructions to point towards …
JacksonBurns Oct 3, 2024
988d07b
update developer installation instructions to parity with user instru…
JacksonBurns Oct 3, 2024
74ef5e6
Merge pull request #2719 from ReactionMechanismGenerator/fix/miniforge
JacksonBurns Oct 8, 2024
0c74d3a
Added custom condarc that disables default channel
ssun30 Oct 9, 2024
1b37764
Replaced nomkl in environment.yml
ssun30 Oct 11, 2024
704632d
Merge pull request #2723 from ReactionMechanismGenerator/miniforge_ac…
JacksonBurns Oct 15, 2024
3660d8f
Changed Dockerfile to use Miniforge3
ssun30 Oct 26, 2024
43d5bf8
Merge pull request #2724 from ReactionMechanismGenerator/docker_minif…
JacksonBurns Oct 28, 2024
82638fc
sign error in objective, clarify some variable names
JacksonBurns Oct 29, 2024
78ac67f
add gcc to environment file for rdkit
JacksonBurns Oct 29, 2024
efea287
Merge remote-tracking branch 'ReactionMechanismGenerator/main' into f…
JacksonBurns Oct 29, 2024
c4c6a0f
I don't think all these vars are requried
JacksonBurns Oct 30, 2024
7f425a1
chatgpt says attached error might be because boost is missing
JacksonBurns Oct 30, 2024
1d71ec4
i don't think we need this one either
JacksonBurns Oct 30, 2024
a450a48
install libstdcxx in cond env? or is this a LD path issue?
JacksonBurns Oct 30, 2024
4cefabf
try using cross-platform compilers package
JacksonBurns Oct 30, 2024
b2ba22f
set ld_library_path
JacksonBurns Oct 30, 2024
3a6b595
use julia 1.9, set depot path for juliaup
JacksonBurns Oct 30, 2024
040f03d
also set the julia depot path
JacksonBurns Oct 30, 2024
b8817ad
don't set ld_library_path
JacksonBurns Oct 30, 2024
67aff20
try a different configuration of environment variables
JacksonBurns Oct 30, 2024
cbb91fa
also set julia depot?
JacksonBurns Oct 31, 2024
9df0540
revert to only setting the current condapkg which should be the only …
JacksonBurns Oct 31, 2024
fabc0f8
add `libstdcxx-ng` to see if the CI will pass on Linux at least
JacksonBurns Oct 31, 2024
22bef3f
Unit test for drawing poly-dentate species.
rwest Jul 30, 2024
9c6a43d
One more test molecule for drawing a 4-dentate adsorbate.
rwest Jul 30, 2024
aded41d
Draw bidentate adsorbates better.
rwest Jul 30, 2024
f493021
Better drawing of polydentate (n>2) adsorbates.
rwest Jul 30, 2024
a43619c
Rotate bidentates so the sites are horizontally aligned
rwest Jul 30, 2024
84fd6a1
Clean up files after testing drawings.
rwest Jul 30, 2024
46ad07f
Small optimization.
rwest Jul 31, 2024
852e55d
Don't bond together sites that are attached to the main ring system.
rwest Jul 31, 2024
cb94803
If you have more than 3 sites, rotate molecule and draw sites vertica…
rwest Jul 31, 2024
d30b496
Use the new rotating method for all polydentates.
rwest Jul 31, 2024
d2f9ab6
Simplify drawing of ring-adsorbates
rwest Aug 1, 2024
6c7f39e
Lower the sites a bit for some molecules.
rwest Aug 1, 2024
4452f1f
Small optimization
rwest Aug 1, 2024
813da5d
Tidying up the new coordinate code a bit. Reduce redundancy.
rwest Aug 1, 2024
af72ade
Don't mess with drawing surface sites if there are more than 4.
rwest Aug 1, 2024
1eae699
Test: Draw a crazy big polydentate adsorbate
rwest Aug 1, 2024
6b1e3f3
Changing terminology. adatoms
rwest Aug 2, 2024
9a95820
Change terminology in _[dis]connect_surface_sites
rwest Aug 2, 2024
dfcfa06
If more than 3 surface sites, don't connect sites that aren't neighbors.
rwest Aug 7, 2024
b9c7cfc
If adsorbate site drawing causes problems, do it without.
rwest Aug 7, 2024
89990ad
Remove some now-redundant imports.
rwest Aug 7, 2024
fd5bdfa
Two more test molecules for adsorbate drawing.
rwest Aug 7, 2024
b30535b
Merge PR #2698 branch 'drawbidentate'.
rwest Nov 20, 2024
081ef32
Merge remote-tracking branch 'ReactionMechanismGenerator/main' into f…
JacksonBurns Nov 20, 2024
8e9f4ec
Merge branch 'fix/avoid_unnecessary_julia' into feat/resonance_scipy
JacksonBurns Nov 20, 2024
a3283b3
remove old julia install step
JacksonBurns Nov 20, 2024
3605e25
add a test run that doesn't need julia
JacksonBurns Nov 20, 2024
02e4140
name the tests based on if julia is installed or not
JacksonBurns Nov 20, 2024
d7274ef
remove libstdcxx and add the new julia conda package (not actually julia
JacksonBurns Nov 20, 2024
de206e4
fix if comparison for matrix
JacksonBurns Nov 20, 2024
cce1f4b
disable running on push, enable running on dispatch
JacksonBurns Nov 20, 2024
eccab98
avoid bugged versions of `quantities`
JacksonBurns Nov 20, 2024
0ba84b3
fix default require_rms values for pdepnetwork update
JacksonBurns Nov 20, 2024
1bd7037
remove the now disallowed array cast
JacksonBurns Nov 20, 2024
0d5a3bc
set allowed version of graphviz, fix list indexeing syntax, fix impor…
JacksonBurns Nov 21, 2024
7fbc38d
get ffmpeg from conda-forge instead of rmg to (hopefully) fix usage e…
JacksonBurns Nov 21, 2024
952b396
disable `shell`, also print `stdout`
JacksonBurns Nov 22, 2024
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
68 changes: 38 additions & 30 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,16 @@
# 2023-07-17 - made it pass by default
# 2023-07-21 - upload the regression results summary as artifact (for use as a comment on PRs)
# 2023-07-31 - removed option to run from RMG-database with GitHub resuable workflows
# 2024-10-01 - deprecated Mambaforge with Miniforge3 for environment creation

name: Continuous Integration

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 @@ -56,8 +57,9 @@ jobs:
matrix:
python-version: ["3.9"]
os: [macos-13, macos-latest, ubuntu-latest]
test_julia: [yes, no]
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} Build and Test Python ${{ matrix.python-version }}
name: ${{ matrix.os }} Build and Test Python ${{ matrix.python-version }} (Julia? ${{ matrix.test_julia }})
# skip scheduled runs from forks
if: ${{ !( github.repository != 'ReactionMechanismGenerator/RMG-Py' && github.event_name == 'schedule' ) }}
env:
Expand All @@ -70,27 +72,28 @@ 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 Mambaforge Python ${{ matrix.python-version }}
uses: conda-incubator/setup-miniconda@v3
with:
environment-file: environment.yml
miniforge-variant: Mambaforge
miniforge-variant: Miniforge3
miniforge-version: latest
python-version: ${{ matrix.python-version }}
condarc-file: condarc.yml
activate-environment: rmg_env
use-mamba: true

- name: Fix ARM Mac environment
if: matrix.os == 'macos-latest'
run: |
conda deactivate
conda env remove -n rmg_env
conda create -n rmg_env
conda activate rmg_env
conda config --env --set subdir osx-64
conda env update -f environment.yml

# list the environment for debugging purposes
- name: mamba info
run: |
Expand Down Expand Up @@ -118,31 +121,36 @@ jobs:

# Setup Juliaup
- name: Set Julia paths
if: matrix.test_julia == 'yes'
run: |
echo "JULIAUP_DEPOT_PATH=$CONDA/envs/rmg_env/.julia" >> $GITHUB_ENV
echo "JULIAUP_DEPOT_PATH=$CONDA/envs/rmg_env/.julia" >> $GITHUB_PATH
echo "JULIA_DEPOT_PATH=$CONDA/envs/rmg_env/.julia" >> $GITHUB_ENV
echo "JULIA_DEPOT_PATH=$CONDA/envs/rmg_env/.julia" >> $GITHUB_PATH
echo "JULIA_CONDAPKG_EXE=$CONDA/condabin/mamba" >> $GITHUB_ENV
echo "JULIA_CONDAPKG_EXE=$CONDA/condabin/mamba" >> $GITHUB_PATH
echo "JULIA_CONDAPKG_EXE=$CONDA/condabin/mamba" >> $GITHUB_ENV
echo "JULIA_CONDAPKG_EXE=$CONDA/condabin/mamba" >> $GITHUB_PATH
# echo "JULIAUP_DEPOT_PATH=$CONDA/envs/rmg_env/.julia" >> $GITHUB_ENV
# echo "JULIAUP_DEPOT_PATH=$CONDA/envs/rmg_env/.julia" >> $GITHUB_PATH
# echo "JULIA_DEPOT_PATH=$CONDA/envs/rmg_env/.julia" >> $GITHUB_ENV
# echo "JULIA_DEPOT_PATH=$CONDA/envs/rmg_env/.julia" >> $GITHUB_PATH
# echo "JULIA_CONDAPKG_EXE=$CONDA/condabin/mamba" >> $GITHUB_ENV
# echo "JULIA_CONDAPKG_EXE=$CONDA/condabin/mamba" >> $GITHUB_PATH
# echo "JULIA_CONDAPKG_EXE=$CONDA/condabin/mamba" >> $GITHUB_ENV
# echo "JULIA_CONDAPKG_EXE=$CONDA/condabin/mamba" >> $GITHUB_PATH
echo "JULIA_CONDAPKG_BACKEND=Current" >> $GITHUB_ENV
echo "JULIA_CONDAPKG_BACKEND=Current" >> $GITHUB_PATH
# echo "JULIA_CONDAPKG_BACKEND=Current" >> $GITHUB_PATH

- name: Setup Juliaup
if: matrix.test_julia == 'yes'
uses: julia-actions/install-juliaup@v2
with:
channel: '1.10'
channel: '1.9'

- name: Check Julia version
if: matrix.test_julia == 'yes'
run: julia --version

# RMS installation and linking to Julia
- name: Install and link Julia dependencies
if: matrix.test_julia == 'yes'
timeout-minutes: 120 # this usually takes 20-45 minutes (or hangs for 6+ hours).
# JULIA_CONDAPKG_EXE points to the existing conda/mamba to avoid JuliaCall from installing their own. See https://juliapy.github.io/PythonCall.jl/stable/pythoncall/#If-you-already-have-a-Conda-environment.
run: |
mamba install conda-forge::pyjuliacall
julia -e 'using Pkg; Pkg.add(Pkg.PackageSpec(name="ReactionMechanismSimulator", url="https://github.com/hwpang/ReactionMechanismSimulator.jl.git", rev="fix_installation")); using ReactionMechanismSimulator'

- name: Install Q2DTor
Expand All @@ -158,7 +166,7 @@ jobs:
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;
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 rmg.py test/regression/"$regr_test"/input.py; then
echo "$regr_test" "Executed Successfully"
Expand Down Expand Up @@ -209,16 +217,16 @@ jobs:
- name : Find ID of Reference Results
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# this will search for the last successful execution of CI on main
run: |
run_id=$(gh run list -R ReactionMechanismGenerator/RMG-Py --workflow="Continuous Integration" --branch main --limit 1 --json databaseId --jq '.[0].databaseId')
run_id=$(gh run list -R ReactionMechanismGenerator/RMG-Py --workflow="Continuous Integration" --branch main --limit 15 --json databaseId,conclusion --jq 'map(select(.conclusion == "success")) | .[0].databaseId')
echo "CI_RUN_ID=$run_id" >> $GITHUB_ENV

- name: Retrieve Stable Regression Results
if: ${{ env.REFERENCE_JOB == 'false' }}
uses: actions/download-artifact@v4
with:
# this will search for the last successful execution of CI on main and download
# the stable regression results
# download stable regression results
run-id: ${{ env.CI_RUN_ID }}
repository: ReactionMechanismGenerator/RMG-Py
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -234,7 +242,7 @@ jobs:
run: |
exec 2> >(tee -a regression.stderr >&2) 1> >(tee -a regression.stdout)
mkdir -p "test/regression-diff"
for regr_test in aromatics liquid_oxidation nitrogen oxidation sulfur superminimal RMS_constantVIdealGasReactor_superminimal RMS_CSTR_liquid_oxidation fragment RMS_constantVIdealGasReactor_fragment;
for regr_test in aromatics liquid_oxidation nitrogen oxidation sulfur superminimal RMS_constantVIdealGasReactor_superminimal RMS_CSTR_liquid_oxidation fragment RMS_constantVIdealGasReactor_fragment minimal_surface;
do
echo ""
echo "### Regression test $regr_test:"
Expand Down Expand Up @@ -369,7 +377,7 @@ jobs:
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and Push
uses: docker/build-push-action@v4
uses: docker/build-push-action@v6
with:
push: true
tags: reactionmechanismgenerator/rmg:latest
8 changes: 7 additions & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,18 @@ jobs:
uses: conda-incubator/setup-miniconda@v2
with:
environment-file: environment.yml
miniforge-variant: Mambaforge
miniforge-variant: Miniforge3
miniforge-version: latest
python-version: 3.9
activate-environment: rmg_env
use-mamba: true

# installs the extra RMS conda dependencies
- name: Add RMS dependencies
run: |
mamba install -c conda-forge julia=1.9.1 pyjulia>=0.6
mamba install -c rmg pyrms diffeqpy

- name: Install sphinx
run: mamba install -y sphinx

Expand Down
29 changes: 17 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,29 +23,30 @@ RUN apt-get update && \
apt-get clean -y

# Install conda
RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh && \
bash Miniconda3-latest-Linux-x86_64.sh -b -p /miniconda && \
rm Miniconda3-latest-Linux-x86_64.sh
ENV PATH="$PATH:/miniconda/bin"

# Set solver backend to mamba for speed
RUN conda install -n base conda-libmamba-solver && \
conda config --set solver libmamba
RUN wget "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh" && \
bash Miniforge3-Linux-x86_64.sh -b -p /miniforge && \
rm Miniforge3-Linux-x86_64.sh
ENV PATH="$PATH:/miniforge/bin"

# Set Bash as the default shell for following commands
SHELL ["/bin/bash", "-c"]

# Add build arguments for RMG-Py, RMG-database, and RMS branches.
ARG RMG_Py_Branch=main
ARG RMG_Database_Branch=main
ARG RMS_Branch=main
ENV rmsbranch=${RMS_Branch}

# cd
WORKDIR /rmg

# Clone the RMG base and database repositories
RUN git clone --single-branch --branch main --depth 1 https://github.com/ReactionMechanismGenerator/RMG-Py.git && \
git clone --single-branch --branch main --depth 1 https://github.com/ReactionMechanismGenerator/RMG-database.git
RUN git clone --single-branch --branch ${RMG_Py_Branch} --depth 1 https://github.com/ReactionMechanismGenerator/RMG-Py.git && \
git clone --single-branch --branch ${RMG_Database_Branch} --depth 1 https://github.com/ReactionMechanismGenerator/RMG-database.git

WORKDIR /rmg/RMG-Py
# build the conda environment
RUN conda env create --file environment.yml && \
conda clean --all --yes
RUN conda env create --file environment.yml

# This runs all subsequent commands inside the rmg_env conda environment
#
Expand All @@ -54,6 +55,10 @@ RUN conda env create --file environment.yml && \
# in a Dockerfile build script)
SHELL ["conda", "run", "--no-capture-output", "-n", "rmg_env", "/bin/bash", "-c"]

RUN conda install -c conda-forge julia=1.9.1 pyjulia>=0.6 && \
conda install -c rmg pyrms diffeqpy && \
conda clean --all --yes

# Set environment variables as directed in the RMG installation instructions
ENV RUNNER_CWD=/rmg
ENV PYTHONPATH="$RUNNER_CWD/RMG-Py:$PYTHONPATH"
Expand Down
Loading
Loading