Skip to content

Commit

Permalink
Extend tests for split_trains slightly
Browse files Browse the repository at this point in the history
  • Loading branch information
takluyver committed Oct 27, 2023
1 parent 7a9ddcb commit 885c835
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions extra_data/tests/test_reader_mockdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,8 @@ def test_split_trains(mock_fxe_raw_run):
chunks = list(run.split_trains(3))
assert len(chunks) == 3
assert {len(c.train_ids) for c in chunks} == {160}
arr = chunks[0]['FXE_XAD_GEC/CAM/CAMERA:daqOutput', 'data.image.dims'].ndarray()
assert arr.shape == (160, 2)

chunks = list(run.split_trains(4, trains_per_part=100))
assert len(chunks) == 5
Expand Down
2 changes: 2 additions & 0 deletions extra_data/tests/test_sourcedata.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ def test_split_trains(mock_spb_raw_run):
chunks = list(xgm.split_trains(3))
assert len(chunks) == 3
assert {len(c.train_ids) for c in chunks} == {21, 22}
# The middle chunk spans across 2 files
assert [len(c.files) for c in chunks] == [1, 2, 1]

chunks = list(xgm.split_trains(3, trains_per_part=20))
assert len(chunks) == 4
Expand Down

0 comments on commit 885c835

Please sign in to comment.