From ffa6d8ff326083a68f9552ed1d74a3b9fb918dcc Mon Sep 17 00:00:00 2001 From: Jackson Burns <33505528+JacksonBurns@users.noreply.github.com> Date: Tue, 17 Oct 2023 10:56:12 -0500 Subject: [PATCH] temporarily remove `chemprop` support completely --- .conda/meta.yaml | 1 - environment.yml | 7 ++----- rmgpy/ml/estimator.py | 14 ++++++++++++-- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/.conda/meta.yaml b/.conda/meta.yaml index b1df7678e6..7cd02969fe 100644 --- a/.conda/meta.yaml +++ b/.conda/meta.yaml @@ -30,7 +30,6 @@ requirements: - cairocffi - cantera >=2.3.0 - cclib >=1.6.3 - - chemprop - coolprop - coverage - cython >=0.25.2 diff --git a/environment.yml b/environment.yml index 0c18ef1f22..b13d9cc50f 100644 --- a/environment.yml +++ b/environment.yml @@ -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: @@ -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 diff --git a/rmgpy/ml/estimator.py b/rmgpy/ml/estimator.py index 84cafb651c..81e1d9e701 100644 --- a/rmgpy/ml/estimator.py +++ b/rmgpy/ml/estimator.py @@ -32,10 +32,10 @@ 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 @@ -43,6 +43,16 @@ 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: """ @@ -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