Skip to content

Commit 0be289b

Browse files
committed
Chemkin-read: skip reactions with unit errors.
The assumed units for a fourth order surface reaction are not currently allowed by the Quantities package for a SurfaceRateCoefficient expression so it raises a QuantityError. This will now just skip the reaction.
1 parent 72f8896 commit 0be289b

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

rmgpy/chemkin.pyx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ from rmgpy.data.kinetics.library import LibraryReaction
4747
from rmgpy.exceptions import ChemkinError
4848
from rmgpy.molecule.element import get_element
4949
from rmgpy.molecule.util import get_element_count
50-
from rmgpy.quantity import Quantity
50+
from rmgpy.quantity import Quantity, QuantityError
5151
from rmgpy.reaction import Reaction
5252
from rmgpy.rmg.pdep import PDepNetwork, PDepReaction
5353
from rmgpy.species import Species
@@ -1487,6 +1487,9 @@ def read_reactions_block(f, species_dict, read_comments=True):
14871487
continue
14881488
else:
14891489
raise
1490+
except QuantityError as e:
1491+
logging.warning(f"Skipping the reaction {kinetics!r} due to units error: {e}")
1492+
continue
14901493
reaction_list.append(reaction)
14911494

14921495
return reaction_list

0 commit comments

Comments
 (0)