Skip to content

Commit 9bd8f08

Browse files
committed
Rename _shape -> buffer_shape
1 parent 336e9f6 commit 9bd8f08

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

extra_data/components.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -863,7 +863,13 @@ def _all_pulses(self):
863863
psv = self._pulse_sel.value
864864
return isinstance(psv, slice) and psv == slice(0, MAX_PULSES, 1)
865865

866-
def _shape(self, module_gaps=False, roi=()):
866+
def buffer_shape(self, module_gaps=False, roi=()):
867+
"""Get the array shape for this data
868+
869+
If *module_gaps* is True, include space for modules which are missing
870+
from the data. *roi* may be a tuple of slices defining a region of
871+
interest on the inner dimensions of the data.
872+
"""
867873
module_dim = self.det.n_modules if module_gaps else len(self.modno_to_keydata)
868874
nframes_sel = len(self.train_id_coordinates())
869875

@@ -875,7 +881,7 @@ def _shape(self, module_gaps=False, roi=()):
875881

876882
@property
877883
def shape(self):
878-
return self._shape()
884+
return self.buffer_shape()
879885

880886
def train_id_coordinates(self):
881887
# XTDF 'image' group can have >1 entry per train
@@ -977,7 +983,7 @@ def _read_chunk(self, chunk: DataChunk, mod_out, roi):
977983

978984
def ndarray(self, *, fill_value=None, out=None, roi=(), astype=None, module_gaps=False):
979985
"""Get an array of per-pulse data (image.*) for xtdf detector"""
980-
out_shape = self._shape(module_gaps=module_gaps, roi=roi)
986+
out_shape = self.buffer_shape(module_gaps=module_gaps, roi=roi)
981987

982988
if out is None:
983989
dtype = self._eg_keydata.dtype if astype is None else np.dtype(astype)

0 commit comments

Comments
 (0)