Skip to content

Odd sampling frequency breaks the aligner #42

@au650680

Description

@au650680

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])

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions