diff --git a/ensemble_md/analysis/analyze_matrix.py b/ensemble_md/analysis/analyze_matrix.py index 75fe0f00..82d16d8f 100644 --- a/ensemble_md/analysis/analyze_matrix.py +++ b/ensemble_md/analysis/analyze_matrix.py @@ -18,7 +18,7 @@ from ensemble_md.utils.exceptions import ParameterError -def parse_transmtx(log_file, expanded_ensemble=True): +def calc_transmtx(log_file, expanded_ensemble=True): """ Parses the log file to get the transition matrix of an expanded ensemble or replica exchange simulation. Notably, a theoretical transition matrix diff --git a/ensemble_md/cli/analyze_REXEE.py b/ensemble_md/cli/analyze_REXEE.py index e4a8a297..9b8f8149 100644 --- a/ensemble_md/cli/analyze_REXEE.py +++ b/ensemble_md/cli/analyze_REXEE.py @@ -428,7 +428,6 @@ def main(): # 4-3. Recalculate the free energy profile if subsampling_avg is True if REXEE.subsampling_avg is True: - # TODO: This does not work in the case where there is a pickle file since t_idx_list and g_list are not pickled. One can just delete the pickle file to rerun the analysis though. # noqa: E501 print('\nUsing averaged start index of the equilibrated data and the avearged statistic inefficiency to re-perform free energy calculations ...') # noqa: E501 t_avg = int(np.mean(t_idx_list)) + 1 # Using the ceiling function to be a little more conservative g_avg = np.array(g_list).prod() ** (1/len(g_list)) # geometric mean diff --git a/ensemble_md/tests/test_analyze_matrix.py b/ensemble_md/tests/test_analyze_matrix.py index 570147b5..b532956c 100644 --- a/ensemble_md/tests/test_analyze_matrix.py +++ b/ensemble_md/tests/test_analyze_matrix.py @@ -20,9 +20,9 @@ input_path = os.path.join(current_path, "data") -def test_parse_transmtx(): +def test_calc_transmtx(): # Case 1: Expanded ensemble where there is a transition matrix - A1, B1, C1 = analyze_matrix.parse_transmtx(os.path.join(input_path, 'log/EXE.log')) + A1, B1, C1 = analyze_matrix.calc_transmtx(os.path.join(input_path, 'log/EXE.log')) A1_expected = np.array([[0.5, 0.34782609, 0.15000001, 0, 0, 0], [0.34782609, 0.18181819, 0.15789473, 0.17647059, 0.10526316, 0.125 ], # noqa: E128, E202, E203 [0.15000001, 0.15789473, 0. , 0.14285715, 0.4375 , 0.07692308], # noqa: E202, E203 @@ -51,12 +51,12 @@ def test_parse_transmtx(): # Case 2: Expanded ensemble where there is no transition matrix log = os.path.join(input_path, 'log/EXE_0.log') with pytest.raises(ParseError, match=f'No transition matrices found in {log}.'): - A2, B2, C2 = analyze_matrix.parse_transmtx(log) + A2, B2, C2 = analyze_matrix.calc_transmtx(log) # Case 3: Hamiltonian replica exchange # Note that the transition matrices shown in the log file of different replicas should all be the same. # Here we use log/HREX.log, which is a part of the log file from anthracene HREX. - A3, B3, C3 = analyze_matrix.parse_transmtx(os.path.join(input_path, 'log/HREX.log'), expanded_ensemble=False) + A3, B3, C3 = analyze_matrix.calc_transmtx(os.path.join(input_path, 'log/HREX.log'), expanded_ensemble=False) A3_expected = np.array([[0.7869, 0.2041, 0.0087, 0.0003, 0.0000, 0.0000, 0.0000, 0.0000], # noqa: E128, E202, E203, E501 [0.2041, 0.7189, 0.0728, 0.0041, 0.0001, 0.0000, 0.0000, 0.0000], # noqa: E128, E202, E203 [0.0087, 0.0728, 0.7862, 0.1251, 0.0071, 0.0001, 0.0000, 0.0000], # noqa: E202, E203