Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion arc/plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@ def save_irc_traj_animation(irc_f_path, irc_r_path, out_path):
f.write(' Number Number Type X Y Z\n')
f.write(' ---------------------------------------------------------------------\n')
for i, symbol in enumerate(xyz['symbols']):
el_num, x, y, z = NUMBER_BY_SYMBOL(symbol), xs[i], ys[i], zs[i]
el_num, x, y, z = NUMBER_BY_SYMBOL[symbol], xs[i], ys[i], zs[i]
f.write(f' {i + 1:>5} {el_num} 0 {x} {y} {z}\n')
f.write(' ---------------------------------------------------------------------\n')
f.write(' GradGradGradGradGradGradGradGradGradGradGradGradGradGradGradGradGradGrad\n')
Expand Down
14 changes: 13 additions & 1 deletion arc/plotter_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,16 @@ def test_delete_multi_species_output_file(self):
self.assertFalse(os.path.isfile(os.path.join(ARC_PATH, 'arc', 'testing', 'acetylene.log')))
self.assertFalse(os.path.isfile(os.path.join(ARC_PATH, 'arc', 'testing', 'N-Valeric_Acid.log')))

def test_save_irc_traj_animation(self):
"""Test the save_irc_traj_animation function"""
irc_f_path = os.path.join(ARC_PATH, 'arc', 'testing', 'irc', 'rxn_1_irc_1.out')
irc_r_path = os.path.join(ARC_PATH, 'arc', 'testing', 'irc', 'rxn_1_irc_2.out')
out_path = os.path.join(ARC_PATH, 'arc', 'testing', 'irc', 'rxn_1_irc_animation.out')
self.assertFalse(os.path.isfile(out_path))
plotter.save_irc_traj_animation(irc_f_path, irc_r_path, out_path)
self.assertTrue(os.path.isfile(out_path))


@classmethod
def tearDownClass(cls):
"""A function that is run ONCE after all unit tests in this class."""
Expand All @@ -218,7 +228,9 @@ def tearDownClass(cls):
files_to_remove = [os.path.join(ARC_PATH, 'arc', 'testing', 'bde_report_test.txt'),
os.path.join(ARC_PATH, 'arc', 'testing', 'water.log'),
os.path.join(ARC_PATH, 'arc', 'testing', 'acetylene.log'),
os.path.join(ARC_PATH, 'arc', 'testing', 'N-Valeric_Acid.log'),]
os.path.join(ARC_PATH, 'arc', 'testing', 'N-Valeric_Acid.log'),
os.path.join(ARC_PATH, 'arc', 'testing', 'irc', 'rxn_1_irc_animation.out'),
]
for file_path in files_to_remove:
if os.path.isfile(file_path):
os.remove(file_path)
Expand Down
14 changes: 7 additions & 7 deletions arc/species/converter_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4003,7 +4003,7 @@ def test_modify_coords(self):
new_xyz = converter.modify_coords(coords=xyz1, indices=indices, new_value=new_val,
modification_type=modification_type, mol=mol1)
self.assertTrue(almost_equal_coords_lists(new_xyz, expected_xyz))
self.assertAlmostEqual(converter.get_zmat_param_value(coords=new_xyz, indices=indices, mol=mol1), new_val, 5)
self.assertAlmostEqual(converter.get_zmat_param_value(coords=new_xyz, indices=indices, mol=mol1), new_val, 3)

indices, new_val = [1, 0], -1.5
expected_xyz = {'symbols': ('O', 'C', 'C', 'O', 'H', 'H', 'H', 'H'), 'isotopes': (16, 12, 12, 16, 1, 1, 1, 1),
Expand Down Expand Up @@ -4034,7 +4034,7 @@ def test_modify_coords(self):
new_xyz = converter.modify_coords(coords=xyz1, indices=indices, new_value=new_val,
modification_type=modification_type, mol=mol1)
self.assertTrue(almost_equal_coords_lists(new_xyz, expected_xyz))
self.assertAlmostEqual(converter.get_zmat_param_value(coords=new_xyz, indices=indices, mol=mol1), new_val, 5)
self.assertAlmostEqual(converter.get_zmat_param_value(coords=new_xyz, indices=indices, mol=mol1), new_val, 3)

# test changing an angle to 180 degrees
indices, new_val = [0, 1, 2], 180
Expand Down Expand Up @@ -4080,7 +4080,7 @@ def test_modify_coords(self):
new_xyz = converter.modify_coords(coords=xyz1, indices=indices, new_value=new_val,
modification_type=modification_type, mol=mol1)
self.assertTrue(almost_equal_coords_lists(new_xyz, expected_xyz))
self.assertAlmostEqual(converter.get_zmat_param_value(coords=new_xyz, indices=indices, mol=mol1), new_val, 5)
self.assertAlmostEqual(converter.get_zmat_param_value(coords=new_xyz, indices=indices, mol=mol1), new_val, 3)

indices, new_val = [3, 2, 1, 0], -30
expected_xyz = {'symbols': ('O', 'C', 'C', 'O', 'H', 'H', 'H', 'H'), 'isotopes': (16, 12, 12, 16, 1, 1, 1, 1),
Expand Down Expand Up @@ -4131,7 +4131,7 @@ def test_modify_coords(self):
new_xyz = converter.modify_coords(coords=xyz1, indices=indices, new_value=new_val,
modification_type=modification_type, mol=mol1)
self.assertTrue(almost_equal_coords_lists(new_xyz, expected_xyz))
self.assertAlmostEqual(converter.get_zmat_param_value(coords=new_xyz, indices=indices, mol=mol1), new_val, 5)
self.assertAlmostEqual(converter.get_zmat_param_value(coords=new_xyz, indices=indices, mol=mol1), new_val, 3)

# test A_group modification
indices, new_val = [0, 1, 2], 160
Expand All @@ -4147,7 +4147,7 @@ def test_modify_coords(self):
new_xyz = converter.modify_coords(coords=xyz1, indices=indices, new_value=new_val,
modification_type=modification_type, mol=mol1)
self.assertTrue(almost_equal_coords_lists(new_xyz, expected_xyz))
self.assertAlmostEqual(converter.get_zmat_param_value(coords=new_xyz, indices=indices, mol=mol1), new_val, 5)
self.assertAlmostEqual(converter.get_zmat_param_value(coords=new_xyz, indices=indices, mol=mol1), new_val, 3)

indices, new_val = [1, 2, 5], 160
expected_xyz = {'symbols': ('O', 'C', 'C', 'S', 'O', 'C', 'C', 'H', 'H', 'H', 'H', 'H', 'H', 'H', 'H', 'H'),
Expand Down Expand Up @@ -4211,7 +4211,7 @@ def test_modify_coords(self):
new_xyz = converter.modify_coords(coords=xyz1, indices=indices, new_value=new_val,
modification_type=modification_type, mol=mol1)
self.assertTrue(almost_equal_coords_lists(new_xyz, expected_xyz))
self.assertAlmostEqual(converter.get_zmat_param_value(coords=new_xyz, indices=indices, mol=mol1), new_val, 5)
self.assertAlmostEqual(converter.get_zmat_param_value(coords=new_xyz, indices=indices, mol=mol1), new_val, 3)

indices, new_val = [5, 2, 1, 0], 180
expected_xyz = {'symbols': ('O', 'C', 'C', 'S', 'O', 'C', 'C', 'H', 'H', 'H', 'H', 'H', 'H', 'H', 'H', 'H'),
Expand Down Expand Up @@ -4278,7 +4278,7 @@ def test_modify_coords(self):
new_xyz = converter.modify_coords(coords=xyz1, indices=indices, new_value=new_val,
modification_type=modification_type, mol=mol1)
self.assertTrue(almost_equal_coords_lists(new_xyz, expected_xyz))
self.assertAlmostEqual(converter.get_zmat_param_value(coords=new_xyz, indices=indices, mol=mol1), new_val, 4)
self.assertAlmostEqual(converter.get_zmat_param_value(coords=new_xyz, indices=indices, mol=mol1), new_val, 3)
self.assertAlmostEqual(converter.get_zmat_param_value(coords=xyz1, indices=[4, 1, 2, 3], mol=mol1),
176.7937925, 4)
self.assertAlmostEqual(converter.get_zmat_param_value(coords=new_xyz, indices=[4, 1, 2, 3], mol=mol1),
Expand Down
Loading