File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff 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 :
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments