Skip to content

Commit 7ebe1a5

Browse files
committed
Minor tweaks
1 parent 074dd47 commit 7ebe1a5

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

ensemble_md/analysis/analyze_matrix.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from ensemble_md.utils.exceptions import ParameterError
1919

2020

21-
def parse_transmtx(log_file, expanded_ensemble=True):
21+
def calc_transmtx(log_file, expanded_ensemble=True):
2222
"""
2323
Parses the log file to get the transition matrix of an expanded ensemble
2424
or replica exchange simulation. Notably, a theoretical transition matrix

ensemble_md/cli/analyze_REXEE.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,6 @@ def main():
428428

429429
# 4-3. Recalculate the free energy profile if subsampling_avg is True
430430
if REXEE.subsampling_avg is True:
431-
# 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
432431
print('\nUsing averaged start index of the equilibrated data and the avearged statistic inefficiency to re-perform free energy calculations ...') # noqa: E501
433432
t_avg = int(np.mean(t_idx_list)) + 1 # Using the ceiling function to be a little more conservative
434433
g_avg = np.array(g_list).prod() ** (1/len(g_list)) # geometric mean

ensemble_md/tests/test_analyze_matrix.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
input_path = os.path.join(current_path, "data")
2121

2222

23-
def test_parse_transmtx():
23+
def test_calc_transmtx():
2424
# Case 1: Expanded ensemble where there is a transition matrix
25-
A1, B1, C1 = analyze_matrix.parse_transmtx(os.path.join(input_path, 'log/EXE.log'))
25+
A1, B1, C1 = analyze_matrix.calc_transmtx(os.path.join(input_path, 'log/EXE.log'))
2626
A1_expected = np.array([[0.5, 0.34782609, 0.15000001, 0, 0, 0],
2727
[0.34782609, 0.18181819, 0.15789473, 0.17647059, 0.10526316, 0.125 ], # noqa: E128, E202, E203
2828
[0.15000001, 0.15789473, 0. , 0.14285715, 0.4375 , 0.07692308], # noqa: E202, E203
@@ -51,12 +51,12 @@ def test_parse_transmtx():
5151
# Case 2: Expanded ensemble where there is no transition matrix
5252
log = os.path.join(input_path, 'log/EXE_0.log')
5353
with pytest.raises(ParseError, match=f'No transition matrices found in {log}.'):
54-
A2, B2, C2 = analyze_matrix.parse_transmtx(log)
54+
A2, B2, C2 = analyze_matrix.calc_transmtx(log)
5555

5656
# Case 3: Hamiltonian replica exchange
5757
# Note that the transition matrices shown in the log file of different replicas should all be the same.
5858
# Here we use log/HREX.log, which is a part of the log file from anthracene HREX.
59-
A3, B3, C3 = analyze_matrix.parse_transmtx(os.path.join(input_path, 'log/HREX.log'), expanded_ensemble=False)
59+
A3, B3, C3 = analyze_matrix.calc_transmtx(os.path.join(input_path, 'log/HREX.log'), expanded_ensemble=False)
6060
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
6161
[0.2041, 0.7189, 0.0728, 0.0041, 0.0001, 0.0000, 0.0000, 0.0000], # noqa: E128, E202, E203
6262
[0.0087, 0.0728, 0.7862, 0.1251, 0.0071, 0.0001, 0.0000, 0.0000], # noqa: E202, E203

0 commit comments

Comments
 (0)