-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added a module for working with RMG reaction families #754
base: main
Are you sure you want to change the base?
Conversation
e36816d
to
e96cb3d
Compare
e96cb3d
to
3b94e7b
Compare
3b94e7b
to
923ea7d
Compare
923ea7d
to
12d0085
Compare
7d65d10
to
828dadd
Compare
|
||
if TYPE_CHECKING: | ||
from arc.species import ARCSpecies | ||
from arc.reaction.reaction import ARCReaction |
Check failure
Code scanning / CodeQL
Module-level cyclic import Error
arc.reaction.reaction
arc.family.family
definition
import
from arc.common import get_logger | ||
from arc.exceptions import ReactionError, InputError | ||
from arc.family.family import ReactionFamily, get_reaction_family_products |
Check failure
Code scanning / CodeQL
Module-level cyclic import Error
arc.family.family
arc.reaction.reaction
definition
import
from arc.common import get_logger | ||
from arc.exceptions import ReactionError, InputError | ||
from arc.family.family import ReactionFamily, get_reaction_family_products |
Check failure
Code scanning / CodeQL
Module-level cyclic import Error
arc.family.family
arc.reaction.reaction
definition
import
6f59670
to
ae816fc
Compare
# def test_check_normal_mode_displacement(self): | ||
# """Test the check_normal_mode_displacement() function.""" | ||
# self.rxn_2a.ts_species.populate_ts_checks() | ||
# self.assertFalse(self.rxn_2a.ts_species.ts_checks['NMD']) | ||
# self.job1.local_path_to_output_file = os.path.join(ts.ARC_PATH, 'arc', 'testing', 'composite', | ||
# 'TS_intra_H_migration_CBS-QB3.out') | ||
# ts.check_normal_mode_displacement(reaction=self.rxn_2a, job=self.job1) | ||
# self.assertTrue(self.rxn_2a.ts_species.ts_checks['NMD']) | ||
# self.rxn_2a.ts_species.populate_ts_checks() | ||
# | ||
# self.rxn_2b.ts_species.populate_ts_checks() | ||
# self.assertFalse(self.rxn_2b.ts_species.ts_checks['NMD']) | ||
# ts.check_normal_mode_displacement(reaction=self.rxn_2b, job=self.job1) | ||
# self.assertFalse(self.rxn_2b.ts_species.ts_checks['NMD']) | ||
# | ||
# # Wrong TS for intra H migration [CH2]CC <=> C[CH]C | ||
# self.job1.local_path_to_output_file = os.path.join(ts.ARC_PATH, 'arc', 'testing', 'composite', | ||
# 'TS_C3_intraH_1.out') # A wrong TS. | ||
# self.rxn_2a.ts_species.populate_ts_checks() | ||
# ts.check_normal_mode_displacement(reaction=self.rxn_2a, job=self.job1) | ||
# self.assertFalse(self.rxn_2a.ts_species.ts_checks['NMD']) | ||
# | ||
# self.job1.local_path_to_output_file = os.path.join(ts.ARC_PATH, 'arc', 'testing', 'composite', | ||
# 'TS_C3_intraH_2.out') # A wrong TS. | ||
# self.rxn_2a.ts_species.populate_ts_checks() | ||
# ts.check_normal_mode_displacement(reaction=self.rxn_2a, job=self.job1) | ||
# self.assertFalse(self.rxn_2a.ts_species.ts_checks['NMD']) | ||
# | ||
# self.job1.local_path_to_output_file = os.path.join(ts.ARC_PATH, 'arc', 'testing', 'composite', | ||
# 'TS_C3_intraH_3.out') # ** The correct TS. ** | ||
# self.rxn_2a.ts_species.populate_ts_checks() | ||
# ts.check_normal_mode_displacement(reaction=self.rxn_2a, job=self.job1) | ||
# self.assertTrue(self.rxn_2a.ts_species.ts_checks['NMD']) | ||
# | ||
# self.job1.local_path_to_output_file = os.path.join(ts.ARC_PATH, 'arc', 'testing', 'composite', | ||
# 'TS_C3_intraH_4.out') # A wrong TS. | ||
# self.rxn_2a.ts_species.populate_ts_checks() | ||
# ts.check_normal_mode_displacement(reaction=self.rxn_2a, job=self.job1) | ||
# self.assertFalse(self.rxn_2a.ts_species.ts_checks['NMD']) | ||
# | ||
# self.job1.local_path_to_output_file = os.path.join(ts.ARC_PATH, 'arc', 'testing', 'composite', | ||
# 'TS_C3_intraH_5.out') # A wrong TS. | ||
# self.rxn_2a.ts_species.populate_ts_checks() | ||
# ts.check_normal_mode_displacement(reaction=self.rxn_2a, job=self.job1) | ||
# self.assertFalse(self.rxn_2a.ts_species.ts_checks['NMD']) | ||
# | ||
# self.job1.local_path_to_output_file = os.path.join(ts.ARC_PATH, 'arc', 'testing', 'composite', | ||
# 'TS_C3_intraH_6.out') # A wrong TS. | ||
# self.rxn_2a.ts_species.populate_ts_checks() | ||
# ts.check_normal_mode_displacement(reaction=self.rxn_2a, job=self.job1) | ||
# self.assertFalse(self.rxn_2a.ts_species.ts_checks['NMD']) | ||
# | ||
# self.job1.local_path_to_output_file = os.path.join(ts.ARC_PATH, 'arc', 'testing', 'composite', | ||
# 'TS_C3_intraH_7.out') # A wrong TS. | ||
# self.rxn_2a.ts_species.populate_ts_checks() | ||
# ts.check_normal_mode_displacement(reaction=self.rxn_2a, job=self.job1) | ||
# self.assertFalse(self.rxn_2a.ts_species.ts_checks['NMD']) | ||
# | ||
# self.job1.local_path_to_output_file = os.path.join(ts.ARC_PATH, 'arc', 'testing', 'freq', | ||
# 'TS_C3_intraH_8.out') # Correct TS (freq run, not composite). | ||
# self.rxn_2a.ts_species.populate_ts_checks() | ||
# self.assertFalse(self.rxn_2a.ts_species.ts_checks['NMD']) | ||
# ts.check_normal_mode_displacement(reaction=self.rxn_2a, job=self.job1) | ||
# self.assertTrue(self.rxn_2a.ts_species.ts_checks['NMD']) | ||
# | ||
# # CCO[O] + CC <=> CCOO + [CH2]C, incorrect TS: | ||
# self.job1.local_path_to_output_file = os.path.join(ts.ARC_PATH, 'arc', 'testing', 'composite', | ||
# 'TS0_composite_2043.out') | ||
# self.rxn_4.ts_species.populate_ts_checks() | ||
# ts.check_normal_mode_displacement(reaction=self.rxn_4, job=self.job1) | ||
# self.assertFalse(self.rxn_4.ts_species.ts_checks['NMD']) | ||
# | ||
# # CCO[O] + CC <=> CCOO + [CH2]C, correct TS: | ||
# self.job1.local_path_to_output_file = os.path.join(ts.ARC_PATH, 'arc', 'testing', 'composite', | ||
# 'TS0_composite_2102.out') | ||
# self.rxn_4.ts_species.populate_ts_checks() | ||
# ts.check_normal_mode_displacement(reaction=self.rxn_4, job=self.job1) | ||
# self.assertTrue(self.rxn_4.ts_species.ts_checks['NMD']) | ||
# | ||
# # NCC + H <=> CH3CHNH2 + H2, correct TS: | ||
# self.job1.local_path_to_output_file = os.path.join(ts.ARC_PATH, 'arc', 'testing', 'composite', | ||
# 'TS0_composite_2044.out') | ||
# self.rxn_5.ts_species.populate_ts_checks() | ||
# ts.check_normal_mode_displacement(reaction=self.rxn_5, job=self.job1) | ||
# self.assertTrue(self.rxn_5.ts_species.ts_checks['NMD']) | ||
# | ||
# # NH2 + N2H3 <=> NH + N2H4: | ||
# self.job1.local_path_to_output_file = os.path.join(ts.ARC_PATH, 'arc', 'testing', 'freq', 'TS_NH2+N2H3.out') | ||
# rxn_6 = ARCReaction(r_species=[ARCSpecies(label='NH2', xyz="""N 0.00000000 -0.00000000 0.14115400 |
Check notice
Code scanning / CodeQL
Commented-out code Note
# def test_check_normal_mode_displacement_wip(self): | ||
# """Test the check_normal_mode_displacement() function.""" | ||
# self.job1.local_path_to_output_file = os.path.join(ts.ARC_PATH, 'arc', 'testing', 'freq', | ||
# 'TS_NH3+H=NH2+H2.out') # NH3 + H <=> NH2 + H2 | ||
# self.rxn_3.ts_species.populate_ts_checks() | ||
# self.assertFalse(self.rxn_3.ts_species.ts_checks['NMD']) | ||
# ts.check_normal_mode_displacement(reaction=self.rxn_3, job=self.job1) | ||
# self.assertTrue(self.rxn_3.ts_species.ts_checks['NMD']) |
Check notice
Code scanning / CodeQL
Commented-out code Note
# def test_get_expected_num_atoms_with_largest_normal_mode_disp(self): | ||
# """Test the get_expected_num_atoms_with_largest_normal_mode_disp() function""" | ||
# normal_disp_mode_rms = [0.01414213562373095, 0.05, 0.04, 0.5632938842203065, 0.7993122043357026, | ||
# 0.08944271909999159, 0.10677078252031312, 0.09000000000000001, 0.05, 0.09433981132056604] | ||
# num_of_atoms = ts.get_expected_num_atoms_with_largest_normal_mode_disp(normal_mode_disp_rms=normal_disp_mode_rms, | ||
# ts_guesses=self.ts_1.ts_guesses) | ||
# self.assertEqual(num_of_atoms, 4) | ||
|
||
# def test_get_rxn_normal_mode_disp_atom_number(self): | ||
# """Test the get_rxn_normal_mode_disp_atom_number() function.""" | ||
# with self.assertRaises(TypeError): | ||
# ts.get_rxn_normal_mode_disp_atom_number('family', rms_list='family') | ||
# with self.assertRaises(TypeError): | ||
# ts.get_rxn_normal_mode_disp_atom_number('family', rms_list=['family']) | ||
# with self.assertRaises(TypeError): | ||
# ts.get_rxn_normal_mode_disp_atom_number('family', rms_list=15.215) | ||
# self.assertEqual(ts.get_rxn_normal_mode_disp_atom_number(), 3) | ||
# self.assertEqual(ts.get_rxn_normal_mode_disp_atom_number('default'), 3) | ||
# self.assertEqual(ts.get_rxn_normal_mode_disp_atom_number('intra_H_migration'), 3) | ||
# self.assertEqual(ts.get_rxn_normal_mode_disp_atom_number('intra_H_migration', rms_list=self.rms_list_1), 4) |
Check notice
Code scanning / CodeQL
Commented-out code Note
ae816fc
to
0329d24
Compare
f112282
to
2d162ce
Compare
xyz_1, xyz_2 = None, None | ||
try: | ||
xyz_1 = new_spc.get_xyz() | ||
except: |
Check notice
Code scanning / CodeQL
Empty except Note
xyz_1, xyz_2 = None, None | ||
try: | ||
xyz_1 = new_spc.get_xyz() | ||
except: |
Check notice
Code scanning / CodeQL
Except block handles 'BaseException' Note
pass | ||
try: | ||
xyz_2 = spc.get_xyz() | ||
except: |
Check notice
Code scanning / CodeQL
Empty except Note
pass | ||
try: | ||
xyz_2 = spc.get_xyz() | ||
except: |
Check notice
Code scanning / CodeQL
Except block handles 'BaseException' Note
It is obsolete now
Currently the rmgdb module is only used by processor which will be dealt with in a different PR
It is no longer an object, no need to call family.label No need to call determine_family() since family is now a property of reaction
f! ts check (? replaced this function?)
f driver
to run RMG as standalone in its own env to get thermo and kinetics for comparisons
when comparing RMG's thermo and kinetics to ARC's computations
960c507
to
64a7b7e
Compare
Now we can identify for each ARC reaction all possible pathways between the reactants and products according to reaction families supported by RMG.
Also added dummy ARC families (w/o kinetics) to assist in identifying reaction templates.
Tests added.