Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…RMG-Py into cov_dep_therm
  • Loading branch information
12Chao committed Mar 30, 2024
2 parents 000f7f5 + eed950a commit 291086f
Show file tree
Hide file tree
Showing 19 changed files with 357 additions and 219 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
7 changes: 2 additions & 5 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,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 Down Expand Up @@ -109,11 +109,9 @@ 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: Patch Environment File
run: sed -i 's/ - conda-forge::julia>=1.8.5,!=1.9.0/ - conda-forge::julia=1.9.1/' environment.yml
- name: Setup Mambaforge Python 3.7
uses: conda-incubator/setup-miniconda@v2
with:
Expand All @@ -132,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
8 changes: 1 addition & 7 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,20 +81,14 @@ jobs:
cd build/html
touch .nojekyll
git add -A --force .
git commit -m "Automated documentation rebuild"
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: Test Publish Documentation
if: ${{ github.event_name != 'push' && github.repository == 'ReactionMechanismGenerator/RMG-Py' }}
run: |
cd documentation/build/html
git push --dry-run origin gh-pages
- name: Publish Updated Documentation
if: ${{ github.event_name == 'push' && github.repository == 'ReactionMechanismGenerator/RMG-Py' }}
run: |
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
17 changes: 7 additions & 10 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
# Changelog:
# - May 15, 2023 Added this changelog, added inline documentation,
# made dependency list more explicit (@JacksonBurns).
# - October 16, 2023 Switched RDKit and descripatastorus to conda-forge,
# moved diffeqpy to pip and (temporarily) removed chemprop
#
name: rmg_env
channels:
Expand Down Expand Up @@ -42,8 +44,9 @@ dependencies:
- coolprop
- cantera::cantera=2.6
- conda-forge::mopac
- conda-forge::cclib >=1.6.3,!=1.8.0
- conda-forge::cclib >=1.6.3,<1.8.0
- conda-forge::openbabel >= 3
- conda-forge::rdkit >=2022.09.1

# general-purpose external software tools
- conda-forge::julia=1.9.1
Expand All @@ -54,7 +57,7 @@ dependencies:
- coverage
- cython >=0.25.2
- scikit-learn
- scipy
- scipy <1.11
- numpy >=1.10.0
- pydot
- jinja2
Expand Down Expand Up @@ -94,14 +97,8 @@ dependencies:
# rather than ours (which is only made so that we can get it from conda)
# It is only on pip, so we will need to do something like:
# https://stackoverflow.com/a/35245610

- rmg::chemprop
# Our build of this is version 0.0.1 (!!) and we are using parts
# of the API that are now gone. Need a serious PR to fix this.

- rmg::rdkit >=2020.03.3.0
# We should use the official channel, not sure how difficult this
# change will be.
# Note that _some other_ dep. in this list requires diffeqpy in its recipe
# which will cause it to be downloaded from the rmg conda channel

# conda mutex metapackage
- nomkl
Expand Down
14 changes: 12 additions & 2 deletions rmgpy/ml/estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,27 @@
from argparse import Namespace
from typing import Callable, Union

chemprop = None
try:
import chemprop
except ImportError as e:
chemprop = None
chemprop_exception = e
import numpy as np

from rmgpy.molecule import Molecule
from rmgpy.species import Species
from rmgpy.thermo import ThermoData

ADMONITION = """
Support for predicting thermochemistry using chemprop has been temporarily removed
from RMG, pending official chemprop support for Python 3.11 and newer.
To use chemprop and RMG, install a previous version of RMG (3.1.1 or earlier).
See the link below for status of re-integration of chemprop:
https://github.com/ReactionMechanismGenerator/RMG-Py/issues/2559
"""


class MLEstimator:
"""
Expand Down Expand Up @@ -118,7 +128,7 @@ def load_estimator(model_dir: str) -> Callable[[str], np.ndarray]:
if chemprop is None:
# Delay chemprop ImportError until we actually try to use it
# so that RMG can load successfully without chemprop.
raise chemprop_exception
raise RuntimeError(ADMONITION + "\nOriginal Exception:\n" + str(chemprop_exception))

args = Namespace() # Simple class to hold attributes

Expand Down

0 comments on commit 291086f

Please sign in to comment.