Skip to content

Commit

Permalink
Fix unit tests for: Don't UNMARK duplicate reactions so aggressively.
Browse files Browse the repository at this point in the history
The new code doesn't remove duplicate reaction marks, so 
this test is marked as a work in progress.

Unless we decide the current behavior is ideal, in which case
we can change the expected outcomes and make this pass.
  • Loading branch information
rwest committed Jul 24, 2023
1 parent 0f5f1d0 commit 13be032
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions rmgpy/chemkinTest.py
Expand Up @@ -30,6 +30,7 @@
import os
import unittest
from unittest import mock
from external.wip import work_in_progress

import rmgpy
from rmgpy.chemkin import get_species_identifier, load_chemkin_file, load_transport_file, mark_duplicate_reactions, \
Expand Down Expand Up @@ -414,6 +415,21 @@ def test_mark_duplicate_reactions(self):

self.assertEqual(duplicate_flags, expected_flags)

@work_in_progress
def test_unmark_duplicate_reactions(self):
"""Test that we can properly REMOVE duplicate reaction flags for Chemkin."""

"""
We can't do this properly yet.
See https://github.com/ReactionMechanismGenerator/RMG-Py/pull/1856
"""
s1 = Species().from_smiles('CC')
s2 = Species().from_smiles('[CH3]')
s3 = Species().from_smiles('[OH]')
s4 = Species().from_smiles('C[CH2]')
s5 = Species().from_smiles('O')
s6 = Species().from_smiles('[H]')

# Try initializing with duplicate=True
reaction_list = [
Reaction(reactants=[s1], products=[s2, s2], duplicate=True, kinetics=Arrhenius()),
Expand All @@ -426,6 +442,8 @@ def test_mark_duplicate_reactions(self):
Reaction(reactants=[s3, s6], products=[s5], duplicate=True, kinetics=Arrhenius(), reversible=False),
]

expected_flags = [True, True, False, False, True, True, False, False]

mark_duplicate_reactions(reaction_list)
duplicate_flags = [rxn.duplicate for rxn in reaction_list]

Expand Down

0 comments on commit 13be032

Please sign in to comment.