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

Collection example is confusing #63

Open daniestevez opened 2 months ago

daniestevez commented 2 months ago

I was looking at the example about how to create a collection in the README and was confused by the following lines:

streams = collection.get_stream_names()
sigmf = [collection.get_SigMFFile(stream) for stream in streams]

The second line overwrites the sigmf identifier (which is how the Python module has been imported), which is not a great idea. This variable sigmf and also streams are not used later on, so it's not too clear why they are created. Given that the next example is how to load a SigMF collection, probably the collection.get_stream_names() call could be moved there to show how it's possible to list the files in the collection. Maybe even something like:

all_sigmffiles = [collection.get_SigMFFile(stream_name=stream_name)
                             for stream_name in collection.get_stream_names()]