From 262ef8093beeb5eb5ffcb6137bd9d4bdde2cffec Mon Sep 17 00:00:00 2001 From: ajfriedman22 Date: Thu, 26 Sep 2024 07:59:07 -0600 Subject: [PATCH] Fix test errors --- ensemble_md/tests/test_coordinate_swap.py | 4 +++- ensemble_md/tests/test_replica_exchange_EE.py | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ensemble_md/tests/test_coordinate_swap.py b/ensemble_md/tests/test_coordinate_swap.py index 3860107..8c56f88 100644 --- a/ensemble_md/tests/test_coordinate_swap.py +++ b/ensemble_md/tests/test_coordinate_swap.py @@ -238,7 +238,9 @@ def test_dummy_real_swap(): test_file = open('test_dummy_real_swap.gro', 'w') df = pd.read_csv(f'{input_path}/coord_swap/df_atom_swap.csv') orig_coords = np.zeros((22, 3)) - orig_coords[18] = [2.5837841, 1.4738766, 2.5511920] + line_num = df['File line'].to_list()[0] + c = line_num - 2 + orig_coords[c] = [2.5837841, 1.4738766, 2.5511920] coordinate_swap.dummy_real_swap(test_file, 1, 'E2F', df[df['Name'] == 'DC8'], ['0.000', '0.000', '0.000\n'], 8, orig_coords) # noqa: E501 test_file.close() diff --git a/ensemble_md/tests/test_replica_exchange_EE.py b/ensemble_md/tests/test_replica_exchange_EE.py index 002579b..a09d901 100644 --- a/ensemble_md/tests/test_replica_exchange_EE.py +++ b/ensemble_md/tests/test_replica_exchange_EE.py @@ -877,7 +877,7 @@ def test_histogram_correction(self, params_dict): def test_default_coords_fn(self, params_dict): REXEE = get_REXEE_instance(params_dict) - REXEE.default_coords_fn(f'{input_path}/coords_swap/test_input_A.gro', f'{input_path}/coords_swap/test_input_B.gro') # noqa: E501 + REXEE.default_coords_fn(f'{input_path}/coord_swap/test_input_A.gro', f'{input_path}/coord_swap/test_input_B.gro') # noqa: E501 true_output_A = open(f'{input_path}/coord_swap/output_A.gro', 'r').readlines() test_output_A = open(f'{input_path}/coord_swap/test_input_B.gro', 'r').readlines() @@ -892,6 +892,7 @@ def test_process_top(self, params_dict): REXEE = get_REXEE_instance(params_dict) REXEE.resname_list = ['A2B', 'B2C', 'C2D', 'D2E', 'E2F'] + REXEE.swap_rep_pattern = [[[0, 1], [1, 0]], [[1, 1], [2, 0]], [[2, 1], [3, 0]], [[3, 1], [4, 0]]] REXEE.top = [f'{input_path}/coord_swap/A-B.top', f'{input_path}/coord_swap/B-C.top', f'{input_path}/coord_swap/C-D.top',