diff --git a/glue/sample/src/sinter/_decoding/_decoding_fusion_blossom.py b/glue/sample/src/sinter/_decoding/_decoding_fusion_blossom.py index ac3e5bfb..c43760fa 100644 --- a/glue/sample/src/sinter/_decoding/_decoding_fusion_blossom.py +++ b/glue/sample/src/sinter/_decoding/_decoding_fusion_blossom.py @@ -24,7 +24,7 @@ def decode_shots_bit_packed( bit_packed_detection_event_data: 'np.ndarray', ) -> 'np.ndarray': num_shots = bit_packed_detection_event_data.shape[0] - predictions = np.zeros(shape=(num_shots, self.num_obs), dtype=np.uint8) + predictions = np.zeros(shape=(num_shots, (self.num_obs + 7) // 8), dtype=np.uint8) import fusion_blossom for shot in range(num_shots): dets_sparse = np.flatnonzero(np.unpackbits(bit_packed_detection_event_data[shot], count=self.num_dets, bitorder='little')) diff --git a/glue/sample/src/sinter/_decoding/_decoding_mwpf.py b/glue/sample/src/sinter/_decoding/_decoding_mwpf.py index 2b69c608..915fd0b0 100644 --- a/glue/sample/src/sinter/_decoding/_decoding_mwpf.py +++ b/glue/sample/src/sinter/_decoding/_decoding_mwpf.py @@ -38,7 +38,7 @@ def decode_shots_bit_packed( bit_packed_detection_event_data: "np.ndarray", ) -> "np.ndarray": num_shots = bit_packed_detection_event_data.shape[0] - predictions = np.zeros(shape=(num_shots, self.num_obs), dtype=np.uint8) + predictions = np.zeros(shape=(num_shots, (self.num_obs + 7) // 8), dtype=np.uint8) import mwpf for shot in range(num_shots):