diff --git a/README.md b/README.md index 0d2e62f..16afd5c 100644 --- a/README.md +++ b/README.md @@ -112,7 +112,6 @@ meta = SigMFFile( SigMFFile.SAMPLE_RATE_KEY: 48000, SigMFFile.AUTHOR_KEY: 'jane.doe@domain.org', SigMFFile.DESCRIPTION_KEY: 'All zero complex float32 example file.', - SigMFFile.VERSION_KEY: sigmf.__version__, } ) @@ -151,7 +150,6 @@ meta_ci16 = SigMFFile( SigMFFile.DATATYPE_KEY: 'ci16_le', # get_data_type_str() is only valid for numpy types SigMFFile.SAMPLE_RATE_KEY: 48000, SigMFFile.DESCRIPTION_KEY: 'All zero complex int16 file.', - SigMFFile.VERSION_KEY: sigmf.__version__, } ) meta_ci16.add_capture(0, metadata=meta.get_capture_info(0)) @@ -161,7 +159,6 @@ collection = SigMFCollection(['example_cf32.sigmf-meta', 'example_ci16.sigmf-met metadata = {'collection': { SigMFCollection.AUTHOR_KEY: 'sigmf@sigmf.org', SigMFCollection.DESCRIPTION_KEY: 'Collection of two all zero files.', - SigMFCollection.VERSION_KEY: sigmf.__version__, } } ) diff --git a/sigmf/sigmffile.py b/sigmf/sigmffile.py index bffd41f..e7fcdda 100644 --- a/sigmf/sigmffile.py +++ b/sigmf/sigmffile.py @@ -174,7 +174,6 @@ def __init__(self, metadata=None, data_file=None, global_info=None, skip_checksu if metadata is None: self._metadata = {self.GLOBAL_KEY:{}, self.CAPTURE_KEY:[], self.ANNOTATION_KEY:[]} self._metadata[self.GLOBAL_KEY][self.NUM_CHANNELS_KEY] = 1 - self._metadata[self.GLOBAL_KEY][self.VERSION_KEY] = __version__ elif isinstance(metadata, dict): self._metadata = metadata else: @@ -184,6 +183,8 @@ def __init__(self, metadata=None, data_file=None, global_info=None, skip_checksu if data_file is not None: self.set_data_file(data_file, skip_checksum=skip_checksum, map_readonly=map_readonly) + self._metadata[self.GLOBAL_KEY][self.VERSION_KEY] = '1.0.0' + def __len__(self): return self._memmap.shape[0] @@ -675,7 +676,6 @@ def __init__(self, metafiles=None, metadata=None, skip_checksums=False): if metadata is None: self._metadata = {self.COLLECTION_KEY:{}} - self._metadata[self.COLLECTION_KEY][self.VERSION_KEY] = __version__ self._metadata[self.COLLECTION_KEY][self.STREAMS_KEY] = [] else: self._metadata = metadata @@ -688,6 +688,8 @@ def __init__(self, metafiles=None, metadata=None, skip_checksums=False): if not self.skip_checksums: self.verify_stream_hashes() + self._metadata[self.COLLECTION_KEY][self.VERSION_KEY] = '1.0.0' + def __len__(self): ''' the length of a collection is the number of streams diff --git a/sigmf/tools/wav2sigmf.py b/sigmf/tools/wav2sigmf.py index 254709e..99e9ee3 100755 --- a/sigmf/tools/wav2sigmf.py +++ b/sigmf/tools/wav2sigmf.py @@ -13,7 +13,6 @@ def writeSigMFArchiveFromWave(input_wav_filename, archive_filename=None, start_d SigMFFile.DATATYPE_KEY: get_data_type_str(wav_data), SigMFFile.SAMPLE_RATE_KEY: samplerate, SigMFFile.DESCRIPTION_KEY: 'Converted from ' + input_wav_filename + '.', - SigMFFile.VERSION_KEY: sigmf.__version__, SigMFFile.NUM_CHANNELS_KEY: 1 if len(wav_data.shape) < 2 else wav_data.shape[1], SigMFFile.RECORDER_KEY: os.path.basename(__file__), } diff --git a/tests/test_archivereader.py b/tests/test_archivereader.py index 9176e32..657d633 100644 --- a/tests/test_archivereader.py +++ b/tests/test_archivereader.py @@ -42,7 +42,6 @@ def test_access_data_without_untar(self): global_info={ SigMFFile.DATATYPE_KEY: f"{complex_prefix}{key}_le", SigMFFile.NUM_CHANNELS_KEY: num_channels, - SigMFFile.VERSION_KEY: sigmf.__version__, }, ) temp_meta.tofile(temp_archive, toarchive=True) diff --git a/tests/testdata.py b/tests/testdata.py index 0a0d5ed..cb05bee 100644 --- a/tests/testdata.py +++ b/tests/testdata.py @@ -34,7 +34,7 @@ SigMFFile.DATATYPE_KEY: 'rf32_le', SigMFFile.HASH_KEY: 'f4984219b318894fa7144519185d1ae81ea721c6113243a52b51e444512a39d74cf41a4cec3c5d000bd7277cc71232c04d7a946717497e18619bdbe94bfeadd6', SigMFFile.NUM_CHANNELS_KEY: 1, - SigMFFile.VERSION_KEY: __version__ + SigMFFile.VERSION_KEY: '1.0.0' } }