Using aligner.py and accelerometer.py to read data from sources with a sampling frequency that is not a multiple of 16 or if the numbers_to_samples is odd too, then after aligning some data may be left in the first key of self.data_map, which leads to batch_size being wrong. This breaks the aligner, since no subsequent package will have that batch_size.
|
def get_batch_size(self) -> Optional[int]: |
|
""" |
|
Returns the number of samples in the first available data batch. |
|
Useful for determining alignment batch size. |
|
""" |
|
with self._lock: |
|
if not self.data_map: |
|
return None |
|
first_key = next(iter(self.data_map)) |
|
return len(self.data_map[first_key]) |
Using aligner.py and accelerometer.py to read data from sources with a sampling frequency that is not a multiple of 16 or if the numbers_to_samples is odd too, then after aligning some data may be left in the first key of self.data_map, which leads to batch_size being wrong. This breaks the aligner, since no subsequent package will have that batch_size.
example-shm/src/data/accel/hbk/accelerometer.py
Lines 95 to 104 in ce47244