Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sigmf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# SPDX-License-Identifier: LGPL-3.0-or-later

# version of this python module
__version__ = "1.11.1"
__version__ = "1.11.2"
# matching version of the SigMF specification
__specification__ = "1.2.6"

Expand Down
1 change: 0 additions & 1 deletion sigmf/archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
from .keys import (
SIGMF_ARCHIVE_EXT,
SIGMF_ARCHIVE_EXTS,
SIGMF_COLLECTION_EXT,
SIGMF_COMPRESSED_EXTS,
SIGMF_DATASET_EXT,
SIGMF_METADATA_EXT,
Expand Down
3 changes: 1 addition & 2 deletions sigmf/archivereader.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@
import zipfile
from pathlib import Path

from . import __version__, keys
from . import keys
from .archive import _detect_compression
from .error import SigMFFileError
from .hashing import calculate_sha512
from .keys import (
SIGMF_ARCHIVE_EXT,
SIGMF_ARCHIVE_EXTS,
SIGMF_DATASET_EXT,
SIGMF_METADATA_EXT,
Expand Down
2 changes: 1 addition & 1 deletion sigmf/convert/signalhound.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def validate_spike(xml_path: Path) -> None:
# validate CenterFrequency
center_freq_raw = _text_of(root, "CenterFrequency")
try:
center_frequency = float(center_freq_raw)
float(center_freq_raw)
except (TypeError, ValueError) as err:
raise SigMFConversionError(f"Invalid or missing CenterFrequency: {center_freq_raw}") from err

Expand Down
1 change: 0 additions & 1 deletion sigmf/convert/wav.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import numpy as np

from .. import SigMFFile
from .. import __version__ as toolversion
from .. import fromfile, keys
from ..error import SigMFFileExistsError
from ..sigmffile import get_sigmf_filenames
Expand Down
4 changes: 2 additions & 2 deletions sigmf/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
import json
from pathlib import Path

from . import __version__ as toolversion
from . import __specification__ as specification

SCHEMA_META = "schema-meta.json"
SCHEMA_COLLECTION = "schema-collection.json"


def get_schema(version=toolversion, schema_file=SCHEMA_META):
def get_schema(version=specification, schema_file=SCHEMA_META):
"""
Load JSON Schema to for either a `sigmf-meta` or `sigmf-collection`.

Expand Down
2 changes: 1 addition & 1 deletion sigmf/siggen.py
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ def _build_metadata(self, samples: np.ndarray) -> dict:
self._description = desc

# build generator info
generator_info = f"SigMFGenerator"
generator_info = "SigMFGenerator"
if self._seed is not None:
generator_info += f"(seed={self._seed:#x})"

Expand Down
5 changes: 2 additions & 3 deletions sigmf/sigmffile.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@

import numpy as np

from . import __specification__, __version__, hashing, keys, schema, validate
from . import __specification__, hashing, keys, schema, validate
from .archive import (
SigMFArchive,
_detect_compression,
_get_archive_basename,
)
from .error import (
SigMFAccessError,
Expand Down Expand Up @@ -1196,7 +1195,7 @@ def tofile(self, file_path, pretty: bool = True, overwrite: bool = False) -> Non

def get_SigMFFile(self, stream_name=None, stream_index=None):
"""
Returns the SigMFFile instance of the specified stream if it exists
Returns the SigMFFile instance of the specified stream if it exists, or None.
"""
if stream_name is not None and stream_name not in self.get_stream_names():
# invalid stream name
Expand Down
3 changes: 1 addition & 2 deletions sigmf/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@
import sys
from copy import deepcopy
from datetime import datetime, timezone
from pathlib import Path

import numpy as np

from .error import SigMFConversionError, SigMFError
from .error import SigMFError

SIGMF_DATETIME_ISO8601_FMT = "%Y-%m-%dT%H:%M:%S.%fZ"

Expand Down
2 changes: 1 addition & 1 deletion sigmf/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import jsonschema

from . import __version__ as toolversion
from . import error, keys, schema, sigmffile
from . import error, schema, sigmffile


def _get_namespaces_declared(metadata: dict) -> set:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import jsonschema
import numpy as np

from sigmf import DATATYPE_KEY, SigMFFile, __specification__, error, fromfile
from sigmf import DATATYPE_KEY, SigMFFile, error, fromfile
from sigmf.archivereader import SigMFArchiveReader

from .testdata import TEST_FLOAT32_DATA, TEST_METADATA
Expand Down
1 change: 0 additions & 1 deletion tests/test_archivereader.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
NUM_CHANNELS_KEY,
SigMFArchiveReader,
SigMFFile,
__specification__,
fromfile,
)

Expand Down
2 changes: 0 additions & 2 deletions tests/test_attributes.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import copy
import unittest

import numpy as np

import sigmf
from sigmf import SigMFFile
from sigmf.error import SigMFAccessError
Expand Down
8 changes: 4 additions & 4 deletions tests/test_convert_blue.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ def tearDown(self) -> None:
"""clean up temporary directory"""
self.tmp_dir.cleanup()

def write_minimal(self, format: bytes = b"CF") -> None:
def write_minimal(self, fmt: bytes = b"CF") -> None:
"""write minimal BLUE file to self.blue_path"""

is_complex = format[0] == ord(b"C")
dtype = TYPE_MAP[chr(format[1])]
is_complex = fmt[0] == ord(b"C")
dtype = TYPE_MAP[chr(fmt[1])]

if np.issubdtype(dtype, np.integer):
scale = 2 ** (np.dtype(dtype).itemsize * 8 - 1)
Expand Down Expand Up @@ -108,7 +108,7 @@ def write_minimal(self, format: bytes = b"CF") -> None:
handle.write(b"BLUEEEEIEEEI") # magic & endianness
handle.seek(32)
handle.write(
struct.pack("<ddi2s", 512, iq_converted.nbytes, 1000, format)
struct.pack("<ddi2s", 512, iq_converted.nbytes, 1000, fmt)
) # data_start, data_size, type, format
handle.seek(56)
handle.write(struct.pack("<d", self.timecode)) # timecode
Expand Down
1 change: 0 additions & 1 deletion tests/test_convert_signalhound.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import tempfile
import unittest
import wave
from pathlib import Path

import numpy as np
Expand Down
1 change: 0 additions & 1 deletion tests/test_ncd.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import shutil
import tempfile
import unittest
import warnings
from pathlib import Path

import numpy as np
Expand Down
2 changes: 0 additions & 2 deletions tests/test_sigmffile.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,12 @@
import shutil
import tempfile
import unittest
import warnings
from pathlib import Path

import numpy as np

import sigmf
from sigmf import SigMFFile, error, utils
from sigmf.sigmffile import _DeprecatingKey, _SigMFDeprecatingMeta

from .testdata import (
TEST_FLOAT32_DATA,
Expand Down
4 changes: 1 addition & 3 deletions tests/testdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@

"""Shared test data for tests."""

from pathlib import Path

import numpy as np

import sigmf
from sigmf import SigMFFile, __specification__, __version__
from sigmf import SigMFFile, __specification__

TEST_FLOAT32_DATA = np.arange(16, dtype=np.float32)
TEST_METADATA = {
Expand Down
Loading