Skip to content

Commit

Permalink
Merge branch 'main' into rms_yaml_write
Browse files Browse the repository at this point in the history
  • Loading branch information
JacksonBurns committed Mar 16, 2024
2 parents 3ae8908 + ff318fc commit 5575370
Show file tree
Hide file tree
Showing 40 changed files with 76,220 additions and 201 deletions.
1 change: 0 additions & 1 deletion .conda/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ requirements:
- cairocffi
- cantera >=2.3.0
- cclib >=1.6.3
- chemprop
- coolprop
- coverage
- cython >=0.25.2
Expand Down
12 changes: 3 additions & 9 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,8 @@ jobs:
run:
shell: bash -l {0}
steps:
- name: Checkout RMG-Py - Resuable Workflow
if: github.repository == 'ReactionMechanismGenerator/RMG-database'
uses: actions/checkout@v3

- name: Clone RMG-Py - RMG-Py
if: github.repository != 'ReactionMechanismGenerator/RMG-database'
uses: actions/checkout@v3
- name: Checkout RMG-Py
uses: actions/checkout@v4

# configures the mamba environment manager and builds the environment
- name: Setup Mambaforge Python 3.7
Expand Down Expand Up @@ -114,7 +109,7 @@ jobs:
shell: bash -l {0}
steps:
- name: Checkout RMG-Py
uses: actions/checkout@v3
uses: actions/checkout@v4

# configures the mamba environment manager and builds the environment
- name: Setup Mambaforge Python 3.7
Expand All @@ -135,7 +130,6 @@ jobs:
# Clone RMG-database
- name: Clone RMG-database
if: github.repository != 'ReactionMechanismGenerator/RMG-database'
run: |
cd ..
git clone -b $RMG_DATABASE_BRANCH https://github.com/ReactionMechanismGenerator/RMG-database.git
Expand Down
86 changes: 53 additions & 33 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,27 @@ on:
branches:
- main
pull_request:
schedule:
# * is a special character in YAML so you have to quote this string
- cron: "0 8 * * 1"

jobs:
build-documentation:
runs-on: ubuntu-latest
strategy:
max-parallel: 5
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v2
- name: Sign into GitHub Actions Bot
run: |
git config --global user.name "github-actions"
git config --global user.email "github-actions@github.com"
- name: Clone RMG-Py
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Setup Mambaforge Python 3.7
uses: conda-incubator/setup-miniconda@v2
with:
Expand All @@ -25,52 +35,62 @@ jobs:
python-version: 3.7
activate-environment: rmg_env
use-mamba: true

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

- name: Mamba info
run: |
mamba info
mamba list
- name: Install and link Julia dependencies
run: |
julia -e "using Pkg; Pkg.add(PackageSpec(url=\"https://github.com/ReactionMechanismGenerator/ReactionMechanismSimulator.jl\", rev=\"main\"))"
julia -e "using Pkg; Pkg.add(\"PyCall\"); Pkg.add(\"DifferentialEquations\")"
python -c "import julia; julia.install()"
- name: Install and compile RMG
- name: Clone RMG-database
run: |
cd ..
git clone https://github.com/ReactionMechanismGenerator/RMG-database.git
cd RMG-Py
sed -i '/embedsignature/s/# //g' setup.py
make
- name: Make documentation - for testing
if: ${{ github.event_name != 'push' || github.repository != 'ReactionMechanismGenerator/RMG-Py' }}
- name: Set Environment Variables
run: |
cd documentation
sphinx-build -b html -d build/doctrees/ source/ build/html -w errors.log -W --keep-going
- name: Report documentation errors
if: ${{ failure() }}
RUNNER_CWD=$(pwd)
echo "PYTHONPATH=$RUNNER_CWD/RMG-Py:$PYTHONPATH" >> $GITHUB_ENV
echo "$RUNNER_CWD/RMG-Py" >> $GITHUB_PATH
- name: make RMG
run: |
cat documentation/errors.log
- name: Make documentation - to publish
if: ${{ github.event_name == 'push' && github.repository == 'ReactionMechanismGenerator/RMG-Py' }}
env:
GH_TOKEN: ${{ secrets.RMG_DEV_TOKEN }}
make clean
make
- name: Install and link Julia dependencies
timeout-minutes: 120 # this usually takes 20-45 minutes (or hangs for 6+ hours).
run: |
make -C documentation continous_integration_setup clean html
python -c "import julia; julia.install(); import diffeqpy; diffeqpy.install()"
julia -e 'using Pkg; Pkg.add(PackageSpec(name="ReactionMechanismSimulator",rev="main")); using ReactionMechanismSimulator'
- name: Checkout gh-pages Branch
uses: actions/checkout@v2
with:
ref: gh-pages
fetch-depth: 0
path: documentation/build/html
clean: false

- name: Build Documentation
run: |
cd documentation
make html
cd build/html
touch .nojekyll
git add -A --force .
git diff --staged --exit-code --quiet || git commit -m "Automated documentation rebuild" # only commit if changes were made
- name: Check documentation links
continue-on-error: true
run: |
cd documentation
sphinx-build -b linkcheck -d build/doctrees/ source/ build/linkcheck | grep -e broken -e redirect | grep -v -e 'redirect https://doi.org/' -e 'broken https://doi.org/.* 403 Client Error: Forbidden'
- name: Publish documentation
- name: Publish Updated Documentation
if: ${{ github.event_name == 'push' && github.repository == 'ReactionMechanismGenerator/RMG-Py' }}
env:
GH_TOKEN: ${{ secrets.RMG_DEV_TOKEN }}
COMMITMESSAGE: "Automatic documentation rebuild"
GIT_AUTHOR_NAME: "RMG Bot"
GIT_AUTHOR_EMAIL: "rmg_dev@mit.edu"
GIT_COMMITTER_NAME: "RMG Bot"
GIT_COMMITTER_EMAIL: "rmg_dev@mit.edu"
run: |
make -C documentation publish
cd documentation/build/html
git push origin gh-pages
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ RUN ln -snf /bin/bash /bin/sh
# - libxrender1 required by RDKit
RUN apt-get update && \
apt-get install -y \
make \
make \
gcc \
wget \
git \
Expand Down Expand Up @@ -42,8 +42,8 @@ WORKDIR /rmg
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

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

Expand All @@ -61,9 +61,11 @@ ENV PATH="$RUNNER_CWD/RMG-Py:$PATH"

# 1. Build RMG
# 2. Install and link Julia dependencies for RMS
# setting this env variable fixes an issue with Julia precompilation on Windows
ENV JULIA_CPU_TARGET="x86-64,haswell,skylake,broadwell,znver1,znver2,znver3,cascadelake,icelake-client,cooperlake,generic"
RUN make && \
julia -e 'using Pkg; Pkg.add(PackageSpec(name="PyCall",rev="master")); Pkg.add(PackageSpec(name="ReactionMechanismSimulator",rev="main")); using ReactionMechanismSimulator' && \
python -c "import julia; julia.install(); import diffeqpy; diffeqpy.install()"
python -c "import julia; julia.install(); import diffeqpy; diffeqpy.install()"

# RMG-Py should now be installed and ready - trigger precompilation and test run
RUN python-jl rmg.py examples/rmg/minimal/input.py
Expand Down
4 changes: 2 additions & 2 deletions arkane/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,11 @@ def update_species_attributes(self, species=None):
self.multiplicity = species.molecule[0].multiplicity
self.formula = species.molecule[0].get_formula()
try:
inchi = to_inchi(species.molecule[0], backend='try-all', aug_level=0)
inchi = to_inchi(species.molecule[0], backend='openbabel-first', aug_level=0)
except ValueError:
inchi = ''
try:
inchi_key = to_inchi_key(species.molecule[0], backend='try-all', aug_level=0)
inchi_key = to_inchi_key(species.molecule[0], backend='openbabel-first', aug_level=0)
except ValueError:
inchi_key = ''
self.inchi = inchi
Expand Down

0 comments on commit 5575370

Please sign in to comment.