Skip to content

Commit aae5529

Browse files
authored
Merge branch 'main' into feature/key-simplification
2 parents 0d31967 + 9a6c80b commit aae5529

3 files changed

Lines changed: 6 additions & 2 deletions

File tree

sigmf/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
# SPDX-License-Identifier: LGPL-3.0-or-later
66

77
# version of this python module
8-
__version__ = "1.11.0"
8+
__version__ = "1.12.0"
9+
910
# matching version of the SigMF specification
1011
__specification__ = "1.2.6"
1112

sigmf/siggen.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,9 @@ def create_full_signal_annotation(label: str) -> dict:
560560
phase_annotation = create_full_signal_annotation(f"phase offset {phase_deg:+.1f}°")
561561
annotations.append(phase_annotation)
562562

563+
# sort annotations by sample_start to satisfy sigmf ordering requirement
564+
annotations.sort(key=lambda a: a[SigMFFile.START_INDEX_KEY])
565+
563566
return annotations
564567

565568
def _build_metadata(self, samples: np.ndarray) -> dict:

tests/test_siggen.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ def test_phase_offset(self):
319319
signal_0 = SigMFGenerator(seed=42).tone().generate()
320320
signal_1 = SigMFGenerator(seed=42).tone().phase_offset(phase_offset).generate()
321321

322-
# find where the actual signal starts by looking at annotations
322+
# tone annotations are last after sorting (full-signal annotations start at 0)
323323
start_idx_0 = signal_0.get_annotations()[0][sigmf.SAMPLE_START_KEY]
324324
start_idx_1 = signal_1.get_annotations()[0][sigmf.SAMPLE_START_KEY]
325325

0 commit comments

Comments
 (0)