Skip to content

Commit a4d503b

Browse files
committed
feat(andata): allow contiguous slice over distributed I/O axis if possible
1 parent a3a7f0e commit a4d503b

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

ch_util/andata.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -850,8 +850,7 @@ def from_acq_h5_fast(cls, fname, comm=None, freq_sel=None, start=None, stop=None
850850
851851
This reads a single file from disk into a distributed container. In
852852
contrast to to `CorrData.from_acq_h5` it is more restrictive,
853-
allowing only contiguous slices of the frequency and time axes,
854-
and no down selection of the input/product/stack axis.
853+
allowing only contiguous axis slices.
855854
856855
Parameters
857856
----------
@@ -882,7 +881,7 @@ def from_acq_h5_fast(cls, fname, comm=None, freq_sel=None, start=None, stop=None
882881
# and are specified here based on performance tests
883882
DSETS_DIRECT = {
884883
"vis": 1,
885-
"gain": 0 if (freq_sel is None) or (freq_sel == slice(None)) else 1,
884+
"gain": 0,
886885
"flags/vis_weight": 1,
887886
}
888887

@@ -892,8 +891,8 @@ def from_acq_h5_fast(cls, fname, comm=None, freq_sel=None, start=None, stop=None
892891
# Check the frequency selection
893892
if freq_sel is None:
894893
freq_sel = slice(None)
895-
if not isinstance(freq_sel, slice):
896-
raise ValueError("freq_sel must be a slice object, not " + repr(freq_sel))
894+
elif not isinstance(freq_sel, slice):
895+
raise ValueError(f"freq_sel must be a slice object, not {freq_sel!r}")
897896

898897
# Create the time selection
899898
time_sel = slice(start, stop)

0 commit comments

Comments
 (0)