Skip to content

Commit 9ec87b6

Browse files
committed
address more pylint nitpicks
1 parent e6242a9 commit 9ec87b6

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

sigmf/convert/signalhound.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def validate_spike(xml_path: Path) -> None:
7676
# validate CenterFrequency
7777
center_freq_raw = _text_of(root, "CenterFrequency")
7878
try:
79-
center_frequency = float(center_freq_raw)
79+
float(center_freq_raw)
8080
except (TypeError, ValueError) as err:
8181
raise SigMFConversionError(f"Invalid or missing CenterFrequency: {center_freq_raw}") from err
8282

sigmf/sigmffile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1195,7 +1195,7 @@ def tofile(self, file_path, pretty: bool = True, overwrite: bool = False) -> Non
11951195

11961196
def get_SigMFFile(self, stream_name=None, stream_index=None):
11971197
"""
1198-
Returns the SigMFFile instance of the specified stream if it exists
1198+
Returns the SigMFFile instance of the specified stream if it exists, or None.
11991199
"""
12001200
if stream_name is not None and stream_name not in self.get_stream_names():
12011201
# invalid stream name

tests/test_convert_blue.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@ def tearDown(self) -> None:
6161
"""clean up temporary directory"""
6262
self.tmp_dir.cleanup()
6363

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

67-
is_complex = format[0] == ord(b"C")
68-
dtype = TYPE_MAP[chr(format[1])]
67+
is_complex = fmt[0] == ord(b"C")
68+
dtype = TYPE_MAP[chr(fmt[1])]
6969

7070
if np.issubdtype(dtype, np.integer):
7171
scale = 2 ** (np.dtype(dtype).itemsize * 8 - 1)
@@ -108,7 +108,7 @@ def write_minimal(self, format: bytes = b"CF") -> None:
108108
handle.write(b"BLUEEEEIEEEI") # magic & endianness
109109
handle.seek(32)
110110
handle.write(
111-
struct.pack("<ddi2s", 512, iq_converted.nbytes, 1000, format)
111+
struct.pack("<ddi2s", 512, iq_converted.nbytes, 1000, fmt)
112112
) # data_start, data_size, type, format
113113
handle.seek(56)
114114
handle.write(struct.pack("<d", self.timecode)) # timecode

0 commit comments

Comments
 (0)