sigmf / sigmf-python

Easily interact with Signal Metadata Format (SigMF) recordings.
https://sigmf.org
GNU Lesser General Public License v3.0
42 stars 16 forks source link

Change __getitem__ to handle a single item or a slice #31

Closed bebau closed 10 months ago

bebau commented 10 months ago

Proposed fix for #25 .

One other difference I noticed between slicing and read_samples() that makes this slicing behavior slightly strange: a slice will not scale int8 data (or similar) to a float, while read_samples will. Maybe that's not a bug and get_item should return truly "raw" data, but it could be warning-worthy.

Teque5 commented 10 months ago

This is just about perfect, but follow this pattern and use a tempfile for the path. I know there are examples in there using /tmp/whatever but that only works on some unix-like systems. I've been meaning to change those all to use the other pattern.

Teque5 commented 10 months ago

Opened #32 as a reminder to fix those testing issues.