Skip to content

Commit

Permalink
Move test_transpose precondition
Browse files Browse the repository at this point in the history
  • Loading branch information
sjperkins committed Mar 25, 2024
1 parent 8c75d2f commit 0cfdf55
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions daskms/experimental/katdal/tests/test_chunkstore.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,11 +289,12 @@ def test_chunkstore(tmp_path_factory, dataset, include_auto_corrs, row_dim, out_
(nbl,) = cp_info.ant1_index.shape
ncorr = read_xds.sizes["corr"]

# This must hold for test_tranpose to work
assert_array_equal(cp_info.cp_index.ravel(), np.arange(nbl * ncorr))

def test_transpose(a):
"""Simple transpose of katdal (time, chan, corrprod) to
(time, bl, chan, corr)."""
# This must hold for this simple tranpose to work
assert_array_equal(cp_info.cp_index.ravel(), np.arange(nbl * ncorr))
o = a.reshape(ntime, nchan, nbl, ncorr).transpose(0, 2, 1, 3)
return o.reshape(-1, nchan, ncorr) if row_dim else o

Expand Down

0 comments on commit 0cfdf55

Please sign in to comment.