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 Dec 30, 2019
1 parent c7fe4a8 commit e11bfdd
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions rmgpy/chemkinTest.py
Expand Up @@ -411,6 +411,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 @@ -423,6 +438,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 e11bfdd

Please sign in to comment.