Skip to content

Commit

Permalink
Merge branch 'master' into new_timer
Browse files Browse the repository at this point in the history
  • Loading branch information
orbeckst authored May 15, 2019
2 parents 586e53b + aa1fd21 commit 6e046da
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions pmda/test/test_leaflet.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@ def correct_values_single_frame(self):
return [np.arange(1, 2150, 12), np.arange(2521, 4670, 12)]

# XFAIL for 2 jobs needs to be fixed!
@pytest.mark.parametrize('n_jobs', (pytest.mark.xfail(-1),
1,
pytest.mark.xfail(2)))
@pytest.mark.parametrize('n_jobs', [
pytest.param(-1, marks=pytest.mark.xfail),
1,
pytest.param(2, marks=pytest.mark.xfail),
])
def test_leaflet(self, universe, correct_values, n_jobs):
lipid_heads = universe.select_atoms("name P and resname POPG")
universe.trajectory.rewind()
Expand Down
4 changes: 2 additions & 2 deletions pmda/test/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,15 @@ def _test_make_balanced_slices(n_blocks, start, stop, step, scale):
if n_frames >= n_blocks:
assert np.all(block_sizes > 0)
minsize = n_frames // n_blocks
assert not np.setdiff1d(block_sizes, [minsize, minsize+1]), \
assert len(np.setdiff1d(block_sizes, [minsize, minsize+1])) == 0, \
"For n_blocks <= n_frames, block sizes are not balanced"
else:
# pathological case; we will have blocks with length 0
# and n_blocks with 1 frame
zero_blocks = block_sizes == 0
assert np.sum(zero_blocks) == n_blocks - n_frames
assert np.sum(~zero_blocks) == n_frames
assert not np.setdiff1d(block_sizes[~zero_blocks], [1]), \
assert len(np.setdiff1d(block_sizes[~zero_blocks], [1])) == 0, \
"For n_blocks>n_frames, some blocks contain != 1 frame"


Expand Down

0 comments on commit 6e046da

Please sign in to comment.