Skip to content

Commit

Permalink
temporarily remove chemprop support completely
Browse files Browse the repository at this point in the history
  • Loading branch information
JacksonBurns committed Mar 6, 2024
1 parent 72886d1 commit ffa6d8f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 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 environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +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
# - 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 @@ -103,10 +104,6 @@ dependencies:
# 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.

# 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 ffa6d8f

Please sign in to comment.