Skip to content

Commit

Permalink
Added a note about the RuntimeWarnings in the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wehs7661 committed Apr 22, 2024
1 parent 5175648 commit 7faf9cf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions ensemble_md/tests/test_analyze_free_energy.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ def test_combine_df_adjacent():
state_ranges = [[0, 1, 2], [1, 2, 3]]

# Test 1: df_err_adjacent is None (in which case err_type is ignored)
# Note that this test would lead to two harmless RuntimWarnings due to calculations like np.std([1], ddof=1), which return NaN # noqa: E501
results = analyze_free_energy._combine_df_adjacent(df_adjacent, state_ranges, None, "propagate")
assert results[0] == [1, 3.5, 6]
assert math.isnan(results[1][0])
Expand Down
1 change: 1 addition & 0 deletions ensemble_md/tests/test_analyze_traj.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ def test_traj2transmtx():
np.testing.assert_array_equal(analyze_traj.traj2transmtx(traj, N, normalize=False), array)

# Case 2: normalize=True
# This test would lead to a harmless RuntimeWarnings due to 0/0 in the last row.
array = np.array([
[0, 0.5, 0, 0.5],
[0.5, 0, 0.5, 0],
Expand Down

0 comments on commit 7faf9cf

Please sign in to comment.