ka9q-python 3.26.2__tar.gz → 3.27.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/CHANGELOG.md +28 -0
  2. {ka9q_python-3.26.2/ka9q_python.egg-info → ka9q_python-3.27.0}/PKG-INFO +6 -1
  3. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/README.md +5 -0
  4. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/docs/API_REFERENCE.md +5 -3
  5. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/examples/advanced_features_demo.py +4 -4
  6. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/ka9q/cli.py +0 -2
  7. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/ka9q/compat.py +1 -1
  8. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/ka9q/control.py +53 -15
  9. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/ka9q/status.py +25 -6
  10. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/ka9q/tui.py +0 -2
  11. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/ka9q/types.py +11 -3
  12. {ka9q_python-3.26.2 → ka9q_python-3.27.0/ka9q_python.egg-info}/PKG-INFO +6 -1
  13. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/ka9q_python.egg-info/SOURCES.txt +1 -0
  14. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/ka9q_radio_compat +1 -1
  15. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/pyproject.toml +1 -1
  16. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/scripts/sync_types.py +34 -0
  17. ka9q_python-3.27.0/tests/test_sweep.py +152 -0
  18. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/LICENSE +0 -0
  19. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/MANIFEST.in +0 -0
  20. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/docs/ARCHITECTURE.md +0 -0
  21. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/docs/CLI_GUIDE.md +0 -0
  22. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/docs/GETTING_STARTED.md +0 -0
  23. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/docs/INSTALLATION.md +0 -0
  24. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/docs/MULTI_STREAM.md +0 -0
  25. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/docs/POLL-SUPPRESSION-DESIGN.md +0 -0
  26. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/docs/RECIPES.md +0 -0
  27. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/docs/REQUIREMENTS.md +0 -0
  28. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/docs/RTP_TIMING_SUPPORT.md +0 -0
  29. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/docs/SECURITY.md +0 -0
  30. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/docs/TESTING_GUIDE.md +0 -0
  31. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/docs/TUI_GUIDE.md +0 -0
  32. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/docs/audit/2026-08-12-alignment/README.md +0 -0
  33. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/docs/audit/2026-08-12-alignment/clients.md +0 -0
  34. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/docs/audit/2026-08-12-alignment/contract.md +0 -0
  35. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/docs/audit/2026-08-12-alignment/control-surface.md +0 -0
  36. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/docs/audit/2026-08-12-alignment/findings.md +0 -0
  37. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/docs/audit/2026-08-12-alignment/idempotency.md +0 -0
  38. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/docs/audit/2026-08-12-alignment/upstream.md +0 -0
  39. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/docs/superpowers/plans/2026-08-12-upstream-alignment-and-client-compat.md +0 -0
  40. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/docs/superpowers/plans/2026-08-13-audit-remediation.md +0 -0
  41. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/docs/superpowers/plans/2026-08-13-client-side-fixes.md +0 -0
  42. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/docs/superpowers/specs/2026-08-12-upstream-alignment-and-client-compat-design.md +0 -0
  43. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/examples/channel_cleanup_example.py +0 -0
  44. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/examples/codar_oceanography.py +0 -0
  45. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/examples/diagnostics/diagnose_packets.py +0 -0
  46. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/examples/diagnostics/repro_utc_bug.py +0 -0
  47. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/examples/discover_example.py +0 -0
  48. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/examples/grape_integration_example.py +0 -0
  49. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/examples/hf_band_scanner.py +0 -0
  50. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/examples/multi_stream_smoke.py +0 -0
  51. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/examples/rtp_recorder_example.py +0 -0
  52. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/examples/simple_am_radio.py +0 -0
  53. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/examples/spectrum_example.py +0 -0
  54. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/examples/stream_example.py +0 -0
  55. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/examples/superdarn_recorder.py +0 -0
  56. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/examples/test_channel_operations.py +0 -0
  57. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/examples/test_improvements.py +0 -0
  58. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/examples/test_timing_fields.py +0 -0
  59. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/examples/tune.py +0 -0
  60. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/examples/tune_example.py +0 -0
  61. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/ka9q/__init__.py +0 -0
  62. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/ka9q/_multicast.py +0 -0
  63. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/ka9q/addressing.py +0 -0
  64. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/ka9q/discovery.py +0 -0
  65. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/ka9q/exceptions.py +0 -0
  66. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/ka9q/managed_stream.py +0 -0
  67. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/ka9q/monitor.py +0 -0
  68. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/ka9q/multi_stream.py +0 -0
  69. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/ka9q/pps_calibrator.py +0 -0
  70. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/ka9q/recovery_ladder.py +0 -0
  71. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/ka9q/resequencer.py +0 -0
  72. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/ka9q/rtp_recorder.py +0 -0
  73. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/ka9q/slot_clock.py +0 -0
  74. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/ka9q/spectrum_stream.py +0 -0
  75. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/ka9q/status_listener.py +0 -0
  76. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/ka9q/stream.py +0 -0
  77. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/ka9q/stream_quality.py +0 -0
  78. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/ka9q/utils.py +0 -0
  79. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/ka9q_python.egg-info/dependency_links.txt +0 -0
  80. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/ka9q_python.egg-info/entry_points.txt +0 -0
  81. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/ka9q_python.egg-info/requires.txt +0 -0
  82. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/ka9q_python.egg-info/top_level.txt +0 -0
  83. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/scripts/check_upstream_drift.py +0 -0
  84. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/scripts/gen_client_manifest.py +0 -0
  85. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/setup.cfg +0 -0
  86. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/tests/__init__.py +0 -0
  87. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/tests/conftest.py +0 -0
  88. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/tests/test_addressing.py +0 -0
  89. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/tests/test_channel_verification.py +0 -0
  90. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/tests/test_client_contract.py +0 -0
  91. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/tests/test_client_id_destination.py +0 -0
  92. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/tests/test_compat_pin_reachability.py +0 -0
  93. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/tests/test_create_split_encoding.py +0 -0
  94. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/tests/test_decode_description.py +0 -0
  95. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/tests/test_decode_functions.py +0 -0
  96. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/tests/test_delivered_rtp_start.py +0 -0
  97. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/tests/test_destination_required.py +0 -0
  98. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/tests/test_encode_functions.py +0 -0
  99. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/tests/test_encode_socket.py +0 -0
  100. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/tests/test_ensure_channel_encoding.py +0 -0
  101. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/tests/test_filter_edges.py +0 -0
  102. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/tests/test_gen_client_manifest.py +0 -0
  103. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/tests/test_idempotency_integration.py +0 -0
  104. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/tests/test_integration.py +0 -0
  105. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/tests/test_iq_20khz_f32.py +0 -0
  106. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/tests/test_keepalive_encoding.py +0 -0
  107. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/tests/test_lifetime.py +0 -0
  108. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/tests/test_listen_multicast.py +0 -0
  109. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/tests/test_managed_stream_recovery.py +0 -0
  110. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/tests/test_monitor.py +0 -0
  111. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/tests/test_multicast_helpers.py +0 -0
  112. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/tests/test_multihomed.py +0 -0
  113. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/tests/test_multistream_completeness.py +0 -0
  114. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/tests/test_multistream_gap_storm.py +0 -0
  115. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/tests/test_multistream_prune.py +0 -0
  116. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/tests/test_multistream_restore.py +0 -0
  117. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/tests/test_native_discovery.py +0 -0
  118. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/tests/test_parameter_vector.py +0 -0
  119. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/tests/test_parse_rtp_samples_iq.py +0 -0
  120. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/tests/test_performance_fixes.py +0 -0
  121. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/tests/test_poll_channel_idle.py +0 -0
  122. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/tests/test_protocol_compat.py +0 -0
  123. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/tests/test_recovery_ladder.py +0 -0
  124. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/tests/test_remove_channel.py +0 -0
  125. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/tests/test_rtp_recorder.py +0 -0
  126. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/tests/test_rtp_to_wallclock_deprecated.py +0 -0
  127. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/tests/test_security_features.py +0 -0
  128. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/tests/test_set_demod_type.py +0 -0
  129. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/tests/test_set_lock_warns.py +0 -0
  130. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/tests/test_set_spectrum.py +0 -0
  131. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/tests/test_slot_clock.py +0 -0
  132. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/tests/test_spectrum.py +0 -0
  133. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/tests/test_ssrc_dest_unit.py +0 -0
  134. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/tests/test_ssrc_encoding_unit.py +0 -0
  135. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/tests/test_ssrc_radiod_host_unit.py +0 -0
  136. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/tests/test_status_decoder.py +0 -0
  137. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/tests/test_status_listener.py +0 -0
  138. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/tests/test_status_socket_drain.py +0 -0
  139. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/tests/test_sync_types.py +0 -0
  140. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/tests/test_ttl_warning.py +0 -0
  141. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/tests/test_tune.py +0 -0
  142. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/tests/test_tune_cli.py +0 -0
  143. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/tests/test_tune_debug.py +0 -0
  144. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/tests/test_tune_live.py +0 -0
  145. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/tests/test_tune_method.py +0 -0
  146. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/tests/test_upstream_drift.py +0 -0
  147. {ka9q_python-3.26.2 → ka9q_python-3.27.0}/tests/test_zero_block_detection.py +0 -0
@@ -1,5 +1,33 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.27.0 (2026-11-11)
4
+
5
+ ### Changed
6
+
7
+ - **The ka9q-radio pin moves from 401992cd (09-19) to aa52698c (11-02),
8
+ Phil's main.** `sync_types.py --apply` regenerated `types.py`. The 167
9
+ commits between them leave the wire format alone: every existing tag keeps
10
+ its number and its encoded type. Phil changed `encode_float` and
11
+ `decode_float` to take and return `float`, but a float still travels in
12
+ 4 bytes and a double in 8.
13
+ - **Phil dropped the doppler tags.** Tags 37 and 38 now read `UNUSED6` and
14
+ `UNUSED7`. `ChannelStatus.doppler` and `doppler_rate` stay, always `None`,
15
+ so code that reads them keeps running. `set_doppler()` raises and points
16
+ to `set_sweep()`. The status decoder no longer names the removed tags; it
17
+ would have raised `AttributeError` on any packet that reached that branch.
18
+
19
+ ### Added
20
+
21
+ - **Sweep (dechirp) support.** radiod's `SWEEP_RATE`, `SWEEP_DURATION`,
22
+ `SWEEP_PERIOD` and `SWEEP_START` (118-121) now come from upstream.
23
+ `RadiodControl.set_sweep()` sets them, and `ChannelStatus` reports them.
24
+ The epoch pair, `SWEEP_EPOCH_SAMPLE` and `SWEEP_EPOCH_FRAC` (217, 216),
25
+ stays in `sync_types.py`'s pending-upstream table until Phil takes the
26
+ dechirp PR and assigns final numbers.
27
+ - **`tests/client_usage_manifest.json` covers what the clients call today.**
28
+ hf-timestd, hfdl-recorder, meteor-scatter, phase-engine, psk-recorder and
29
+ wspr-recorder had come to use symbols the contract test never checked.
30
+
3
31
  ## 3.26.2 (2026-11-01)
4
32
 
5
33
  ### Fixed
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ka9q-python
3
- Version: 3.26.2
3
+ Version: 3.27.0
4
4
  Summary: Python interface for ka9q-radio control and monitoring
5
5
  Author-email: Michael Hauan AC0G <ac0g@hauan.org>
6
6
  License: MIT
@@ -284,6 +284,11 @@ The `--apply` mode updates three files atomically:
284
284
  2. `ka9q_radio_compat` — updated with the new commit hash
285
285
  3. `ka9q/compat.py` — updated with the new commit hash (importable)
286
286
 
287
+ Tags HamSCI defines ahead of upstream (the sweep TLVs) live in
288
+ `PENDING_UPSTREAM_STATUS_TABLE` in `scripts/sync_types.py`; `--apply` re-emits
289
+ them into `types.py`, so it stays idempotent. `--check` fails if upstream
290
+ reuses one of their numbers and warns when upstream gains the name.
291
+
287
292
  ### For Deployment Tooling
288
293
 
289
294
  `ka9q-update` (or any deployment tool) can read the pinned commit to ensure the correct `radiod` version is running:
@@ -250,6 +250,11 @@ The `--apply` mode updates three files atomically:
250
250
  2. `ka9q_radio_compat` — updated with the new commit hash
251
251
  3. `ka9q/compat.py` — updated with the new commit hash (importable)
252
252
 
253
+ Tags HamSCI defines ahead of upstream (the sweep TLVs) live in
254
+ `PENDING_UPSTREAM_STATUS_TABLE` in `scripts/sync_types.py`; `--apply` re-emits
255
+ them into `types.py`, so it stays idempotent. `--check` fails if upstream
256
+ reuses one of their numbers and warns when upstream gains the name.
257
+
253
258
  ### For Deployment Tooling
254
259
 
255
260
  `ka9q-update` (or any deployment tool) can read the pinned commit to ensure the correct `radiod` version is running:
@@ -143,7 +143,7 @@ Tuning & filter:
143
143
  - `set_sample_rate(ssrc, sample_rate)`
144
144
  - `set_shift_frequency(ssrc, shift_hz)`
145
145
  - `set_first_lo(ssrc, frequency_hz)`
146
- - `set_doppler(ssrc, doppler_hz=0.0, doppler_rate_hz_per_sec=0.0)`
146
+ - `set_sweep(ssrc, rate_hz_per_s, period_s, duration_s=None, start_s=0.0)` (replaces retired `set_doppler`, which now raises)
147
147
  - `set_filter(ssrc, low_edge=None, high_edge=None, kaiser_beta=None)`
148
148
  - `set_kaiser_beta(ssrc, beta)`
149
149
  - `set_filter2(ssrc, blocksize, kaiser_beta=None)`
@@ -335,8 +335,10 @@ grouped by category:
335
335
 
336
336
  - **Identification** — `ssrc`, `description`, `preset`, `demod_type`,
337
337
  `rtp_pt`, `command_tag`, `gps_time`, `rtp_timesnap`.
338
- - **Tuning** — `frequency`, `first_lo`, `second_lo`, `shift`,
339
- `doppler`, `doppler_rate`.
338
+ - **Tuning** — `frequency`, `first_lo`, `second_lo`, `shift`.
339
+ (`doppler` and `doppler_rate` remain but stay None: radiod dropped them.)
340
+ - **Sweep** — `sweep_rate`, `sweep_duration`, `sweep_period`, `sweep_start`,
341
+ `sweep_epoch_sample`, `sweep_epoch_frac`.
340
342
  - **Filter** — `low_edge`, `high_edge`, `kaiser_beta`,
341
343
  `filter_blocksize`, `filter_fir_length`, `filter_drops`, `noise_bw`.
342
344
  - **Squelch / AGC / gain** — `snr_squelch_enable`, `squelch_open`,
@@ -18,10 +18,10 @@ def main():
18
18
 
19
19
  print("=== Advanced RadioD Feature Demonstrations ===\n")
20
20
 
21
- # 1. Doppler tracking for satellite reception
22
- print("1. Setting Doppler shift and rate (for satellite tracking)")
23
- control.set_doppler(ssrc=ssrc, doppler_hz=-5000, doppler_rate_hz_per_sec=100)
24
- print(" ✓ Doppler: -5 kHz, rate: 100 Hz/s\n")
21
+ # 1. Linear sweep (dechirp), replaces the retired Doppler command
22
+ print("1. Setting a linear sweep (dechirp)")
23
+ control.set_sweep(ssrc=ssrc, rate_hz_per_s=-25733.913, period_s=1.0)
24
+ print(" ✓ Sweep: -25733.913 Hz/s, period 1 s\n")
25
25
 
26
26
  # 2. PLL configuration for carrier tracking
27
27
  print("2. Configuring PLL for coherent AM detection")
@@ -54,8 +54,6 @@ def _render_status_text(st: ChannelStatus) -> str:
54
54
  L.append(f" First LO: {_fmt_hz(st.first_lo)} lock={fe.lock}")
55
55
  L.append(f" Second LO: {_fmt_hz(st.second_lo)}")
56
56
  L.append(f" Shift: {_fmt_hz(st.shift)}")
57
- if st.doppler:
58
- L.append(f" Doppler: {_fmt_hz(st.doppler)} @ {st.doppler_rate} Hz/s")
59
57
  L.append(f" Filter: {_fmt_hz(st.low_edge)} .. {_fmt_hz(st.high_edge)} (β={st.kaiser_beta})")
60
58
  L.append(f" FE filter: {_fmt_hz(fe.fe_low_edge)} .. {_fmt_hz(fe.fe_high_edge)}")
61
59
  L.append("")
@@ -12,4 +12,4 @@ Usage:
12
12
  print(f"Compatible with ka9q-radio at {KA9Q_RADIO_COMMIT}")
13
13
  """
14
14
 
15
- KA9Q_RADIO_COMMIT: str = "401992cdecaa7f85b093bff053f074453c99bdf5"
15
+ KA9Q_RADIO_COMMIT: str = "aa52698cd1a8718f6adae4da4e4f96ca74eb4147"
@@ -23,7 +23,9 @@ PARAMETERS:
23
23
  import socket
24
24
  import select
25
25
  import struct
26
+ import math
26
27
  import secrets
28
+ import warnings
27
29
  import logging
28
30
  import threading
29
31
  import hashlib
@@ -2624,32 +2626,68 @@ class RadiodControl:
2624
2626
  logger.info("Metrics reset")
2625
2627
 
2626
2628
  def set_doppler(self, ssrc: int, doppler_hz: float = 0.0, doppler_rate_hz_per_sec: float = 0.0):
2629
+ """Retired: radiod dropped DOPPLER_FREQUENCY/_RATE in ka9q 64938af7.
2630
+
2631
+ Use :meth:`set_sweep`. Sends nothing.
2627
2632
  """
2628
- Set Doppler frequency shift and rate for satellite tracking
2629
-
2633
+ warnings.warn("set_doppler is retired; radiod dropped DOPPLER (ka9q 64938af7); use set_sweep",
2634
+ DeprecationWarning, stacklevel=2)
2635
+ raise RuntimeError("radiod dropped DOPPLER (ka9q 64938af7); use set_sweep")
2636
+
2637
+ def set_sweep(self, ssrc: int, rate_hz_per_s: float, period_s: float,
2638
+ duration_s: Optional[float] = None, start_s: float = 0.0) -> None:
2639
+ """
2640
+ Command a linear sweep (dechirp) on a linear-demod channel.
2641
+
2642
+ Sends all four sweep TLVs, zeros explicit, so a command always
2643
+ replaces the whole sweep. radiod checks the merged settings after
2644
+ each command and refuses (logs, leaves the channel unswept) a rate
2645
+ without a period, duration > period, or an NCO-limit violation.
2646
+
2630
2647
  Args:
2631
2648
  ssrc: SSRC of the channel
2632
- doppler_hz: Doppler frequency shift in Hz (default: 0.0)
2633
- doppler_rate_hz_per_sec: Doppler rate in Hz/sec (default: 0.0)
2634
-
2635
- Example:
2636
- >>> # Track satellite with 5 kHz Doppler shift, changing at 100 Hz/sec
2637
- >>> control.set_doppler(ssrc=12345, doppler_hz=5000, doppler_rate_hz_per_sec=100)
2649
+ rate_hz_per_s: sweep rate, Hz/s, signed (positive = up); 0 = no sweep
2650
+ period_s: sweep period in seconds (required for a nonzero rate)
2651
+ duration_s: seconds of each period that sweep (default: whole period)
2652
+ start_s: offset added to the sweep time base, seconds (default 0)
2653
+
2654
+ Raises:
2655
+ ValidationError: non-finite value; rate != 0 without
2656
+ 0 < period <= 1e6 s; duration outside [0, period]
2657
+
2658
+ Note: SWEEP_EPOCH_SAMPLE/FRAC (217/216), which radiod reports, are
2659
+ provisional until Phil assigns final numbers.
2638
2660
  """
2639
2661
  _validate_ssrc(ssrc)
2640
-
2662
+ if duration_s is None:
2663
+ duration_s = period_s
2664
+ for nm, v in (("rate", rate_hz_per_s), ("period", period_s),
2665
+ ("duration", duration_s), ("start", start_s)):
2666
+ if not isinstance(v, (int, float)) or isinstance(v, bool) or not math.isfinite(v):
2667
+ raise ValidationError(f"Sweep {nm} must be a finite number, got {v!r}")
2668
+ if rate_hz_per_s != 0 and not (0 < period_s <= 1e6):
2669
+ raise ValidationError(
2670
+ f"Sweep period must satisfy 0 < period <= 1e6 s with a nonzero rate, got {period_s}")
2671
+ if period_s < 0 or period_s > 1e6:
2672
+ raise ValidationError(f"Sweep period out of range [0, 1e6] s: {period_s}")
2673
+ if not (0 <= duration_s <= period_s):
2674
+ raise ValidationError(
2675
+ f"Sweep duration must satisfy 0 <= duration <= period ({period_s}), got {duration_s}")
2676
+
2641
2677
  cmdbuffer = bytearray()
2642
2678
  cmdbuffer.append(CMD)
2643
-
2644
- encode_double(cmdbuffer, StatusType.DOPPLER_FREQUENCY, doppler_hz)
2645
- encode_double(cmdbuffer, StatusType.DOPPLER_FREQUENCY_RATE, doppler_rate_hz_per_sec)
2679
+ encode_double(cmdbuffer, StatusType.SWEEP_RATE, float(rate_hz_per_s))
2680
+ encode_double(cmdbuffer, StatusType.SWEEP_DURATION, float(duration_s))
2681
+ encode_double(cmdbuffer, StatusType.SWEEP_PERIOD, float(period_s))
2682
+ encode_double(cmdbuffer, StatusType.SWEEP_START, float(start_s))
2646
2683
  encode_int(cmdbuffer, StatusType.OUTPUT_SSRC, ssrc)
2647
2684
  encode_int(cmdbuffer, StatusType.COMMAND_TAG, secrets.randbits(31))
2648
2685
  encode_eol(cmdbuffer)
2649
-
2650
- logger.info(f"Setting Doppler for SSRC {ssrc}: freq={doppler_hz} Hz, rate={doppler_rate_hz_per_sec} Hz/s")
2686
+
2687
+ logger.info(f"Setting sweep for SSRC {ssrc}: rate={rate_hz_per_s} Hz/s, "
2688
+ f"period={period_s} s, duration={duration_s} s, start={start_s} s")
2651
2689
  self.send_command(cmdbuffer)
2652
-
2690
+
2653
2691
  def set_pll(self, ssrc: int, enable: bool, bandwidth_hz: Optional[float] = None, square: bool = False):
2654
2692
  """
2655
2693
  Configure PLL (Phase-Locked Loop) for carrier tracking in linear modes
@@ -209,8 +209,16 @@ class ChannelStatus:
209
209
  first_lo: Optional[float] = None # FIRST_LO_FREQUENCY (also in frontend)
210
210
  second_lo: Optional[float] = None # SECOND_LO_FREQUENCY
211
211
  shift: Optional[float] = None # SHIFT_FREQUENCY
212
- doppler: Optional[float] = None # DOPPLER_FREQUENCY
213
- doppler_rate: Optional[float] = None # DOPPLER_FREQUENCY_RATE
212
+ doppler: Optional[float] = None # always None: radiod dropped DOPPLER (ka9q 64938af7)
213
+ doppler_rate: Optional[float] = None # always None: tags 37/38 are UNUSED6/7 upstream
214
+
215
+ # Sweep (dechirp); radiod reports all four on every linear channel
216
+ sweep_rate: Optional[float] = None # SWEEP_RATE (Hz/s, signed)
217
+ sweep_duration: Optional[float] = None # SWEEP_DURATION (s)
218
+ sweep_period: Optional[float] = None # SWEEP_PERIOD (s)
219
+ sweep_start: Optional[float] = None # SWEEP_START (s)
220
+ sweep_epoch_sample: Optional[int] = None # SWEEP_EPOCH_SAMPLE (signed int64)
221
+ sweep_epoch_frac: Optional[float] = None # SWEEP_EPOCH_FRAC (fraction of a sample)
214
222
 
215
223
  # Filter (primary)
216
224
  low_edge: Optional[float] = None # LOW_EDGE (Hz)
@@ -499,10 +507,21 @@ def decode_status_packet(buffer: bytes) -> Optional[ChannelStatus]:
499
507
  st.frequency = decode_double(data, optlen)
500
508
  elif t == StatusType.SHIFT_FREQUENCY:
501
509
  st.shift = decode_double(data, optlen)
502
- elif t == StatusType.DOPPLER_FREQUENCY:
503
- st.doppler = decode_double(data, optlen)
504
- elif t == StatusType.DOPPLER_FREQUENCY_RATE:
505
- st.doppler_rate = decode_double(data, optlen)
510
+ elif t == StatusType.SWEEP_RATE:
511
+ st.sweep_rate = decode_double(data, optlen)
512
+ elif t == StatusType.SWEEP_DURATION:
513
+ st.sweep_duration = decode_double(data, optlen)
514
+ elif t == StatusType.SWEEP_PERIOD:
515
+ st.sweep_period = decode_double(data, optlen)
516
+ elif t == StatusType.SWEEP_START:
517
+ st.sweep_start = decode_double(data, optlen)
518
+ elif t == StatusType.SWEEP_EPOCH_SAMPLE:
519
+ # Signed: negative early in uptime. A negative int64 always
520
+ # arrives as all 8 bytes (no leading zeros to strip).
521
+ v = decode_int64(data, optlen)
522
+ st.sweep_epoch_sample = v - (1 << 64) if v >= (1 << 63) else v
523
+ elif t == StatusType.SWEEP_EPOCH_FRAC:
524
+ st.sweep_epoch_frac = decode_double(data, optlen)
506
525
 
507
526
  # ---- Demod class / preset ----
508
527
  elif t == StatusType.DEMOD_TYPE:
@@ -127,8 +127,6 @@ class TuningPanel(Panel):
127
127
  f"Filter: {_fmt_hz(st.low_edge)} .. {_fmt_hz(st.high_edge)}",
128
128
  f"FE filter: {_fmt_hz(fe.fe_low_edge)} .. {_fmt_hz(fe.fe_high_edge)}",
129
129
  ]
130
- if st.doppler:
131
- lines.append(f"Doppler: {_fmt_hz(st.doppler)} @ {st.doppler_rate} Hz/s")
132
130
  return "\n".join(lines)
133
131
 
134
132
 
@@ -2,9 +2,11 @@
2
2
  ka9q-radio protocol types and constants
3
3
 
4
4
  Auto-generated by scripts/sync_types.py from ka9q-radio C headers.
5
- Validated against ka9q-radio commit: 401992cdecaa
5
+ Validated against ka9q-radio commit: aa52698cd1a8
6
6
 
7
7
  DO NOT EDIT MANUALLY — run: python scripts/sync_types.py --apply
8
+ Entries marked 'pending upstream' come from PENDING_UPSTREAM_STATUS_TABLE
9
+ in that script; --apply re-emits them.
8
10
  """
9
11
 
10
12
 
@@ -48,8 +50,8 @@ class StatusType:
48
50
  FIRST_LO_FREQUENCY = 34
49
51
  SECOND_LO_FREQUENCY = 35
50
52
  SHIFT_FREQUENCY = 36
51
- DOPPLER_FREQUENCY = 37
52
- DOPPLER_FREQUENCY_RATE = 38
53
+ UNUSED6 = 37
54
+ UNUSED7 = 38
53
55
  LOW_EDGE = 39
54
56
  HIGH_EDGE = 40
55
57
  KAISER_BETA = 41
@@ -129,6 +131,12 @@ class StatusType:
129
131
  SPECTRUM_STEP = 115 # size of byte spectrum data level step, dB
130
132
  SPECTRUM_OVERLAP = 116 # Overlap of FFT windows when averaging (0-1)
131
133
  LIFETIME = 117 # frames until channel goes away
134
+ SWEEP_RATE = 118
135
+ SWEEP_DURATION = 119
136
+ SWEEP_PERIOD = 120
137
+ SWEEP_START = 121
138
+ SWEEP_EPOCH_FRAC = 216 # fraction of an input sample after SWEEP_EPOCH_SAMPLE (double); pending upstream; Phil assigns final numbers
139
+ SWEEP_EPOCH_SAMPLE = 217 # input-counter index of a recent sweep start (SIGNED int64); pending upstream; Phil assigns final numbers
132
140
 
133
141
 
134
142
  # Command packet type
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ka9q-python
3
- Version: 3.26.2
3
+ Version: 3.27.0
4
4
  Summary: Python interface for ka9q-radio control and monitoring
5
5
  Author-email: Michael Hauan AC0G <ac0g@hauan.org>
6
6
  License: MIT
@@ -284,6 +284,11 @@ The `--apply` mode updates three files atomically:
284
284
  2. `ka9q_radio_compat` — updated with the new commit hash
285
285
  3. `ka9q/compat.py` — updated with the new commit hash (importable)
286
286
 
287
+ Tags HamSCI defines ahead of upstream (the sweep TLVs) live in
288
+ `PENDING_UPSTREAM_STATUS_TABLE` in `scripts/sync_types.py`; `--apply` re-emits
289
+ them into `types.py`, so it stays idempotent. `--check` fails if upstream
290
+ reuses one of their numbers and warns when upstream gains the name.
291
+
287
292
  ### For Deployment Tooling
288
293
 
289
294
  `ka9q-update` (or any deployment tool) can read the pinned commit to ensure the correct `radiod` version is running:
@@ -133,6 +133,7 @@ tests/test_ssrc_radiod_host_unit.py
133
133
  tests/test_status_decoder.py
134
134
  tests/test_status_listener.py
135
135
  tests/test_status_socket_drain.py
136
+ tests/test_sweep.py
136
137
  tests/test_sync_types.py
137
138
  tests/test_ttl_warning.py
138
139
  tests/test_tune.py
@@ -1,3 +1,3 @@
1
1
  # ka9q-radio commit that ka9q/types.py was last validated against
2
2
  # Updated by: scripts/sync_types.py --apply
3
- 401992cdecaa7f85b093bff053f074453c99bdf5
3
+ aa52698cd1a8718f6adae4da4e4f96ca74eb4147
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "ka9q-python"
7
- version = "3.26.2"
7
+ version = "3.27.0"
8
8
  description = "Python interface for ka9q-radio control and monitoring"
9
9
  readme = "README.md"
10
10
  authors = [
@@ -247,6 +247,8 @@ def generate_types_py(
247
247
  lines.append(f"Validated against ka9q-radio commit: {commit_hash[:12]}")
248
248
  lines.append("")
249
249
  lines.append("DO NOT EDIT MANUALLY — run: python scripts/sync_types.py --apply")
250
+ lines.append("Entries marked 'pending upstream' come from PENDING_UPSTREAM_STATUS_TABLE")
251
+ lines.append("in that script; --apply re-emits them.")
250
252
  lines.append('"""')
251
253
  lines.append("")
252
254
  lines.append("")
@@ -258,6 +260,11 @@ def generate_types_py(
258
260
  suffix = f" # {comment}" if comment else ""
259
261
  lines.append(f" {name} = {value}{suffix}")
260
262
 
263
+ upstream_names = {n for n, _, _ in status_entries}
264
+ for name, value, comment in PENDING_UPSTREAM_STATUS_TABLE:
265
+ if name not in upstream_names:
266
+ lines.append(f" {name} = {value} # {comment}; {PENDING_COMMENT}")
267
+
261
268
  lines.append("")
262
269
  lines.append("")
263
270
  lines.append("# Command packet type")
@@ -322,6 +329,20 @@ def generate_types_py(
322
329
  # ---------------------------------------------------------------------------
323
330
  # Diff / check / apply
324
331
  # ---------------------------------------------------------------------------
332
+ # StatusType tags HamSCI defines ahead of upstream ka9q-radio (the dechirp
333
+ # branch). generate_types_py() emits them into types.py so --apply is
334
+ # idempotent; _check_enum() tolerates them as EXTRA, fails if upstream reuses
335
+ # one of the numbers under another name, and warns once upstream has the name
336
+ # (then delete the entry here).
337
+ PENDING_UPSTREAM_STATUS_TABLE = [
338
+ ("SWEEP_EPOCH_FRAC", 216, "fraction of an input sample after SWEEP_EPOCH_SAMPLE (double)"),
339
+ ("SWEEP_EPOCH_SAMPLE", 217, "input-counter index of a recent sweep start (SIGNED int64)"),
340
+ ]
341
+ PENDING_COMMENT = "pending upstream; Phil assigns final numbers"
342
+ PENDING_UPSTREAM_STATUS = {n for n, _, _ in PENDING_UPSTREAM_STATUS_TABLE}
343
+ _PENDING_BY_VALUE = {v: n for n, v, _ in PENDING_UPSTREAM_STATUS_TABLE}
344
+
345
+
325
346
  def _check_enum(
326
347
  label: str,
327
348
  c_entries: List[Tuple[str, int, str]],
@@ -333,6 +354,17 @@ def _check_enum(
333
354
  alias_names = set()
334
355
  issues: List[str] = []
335
356
  c_map = {name: val for name, val, _ in c_entries}
357
+ if label == "StatusType":
358
+ for name, val, _ in c_entries:
359
+ if val in _PENDING_BY_VALUE and name != _PENDING_BY_VALUE[val]:
360
+ issues.append(
361
+ f"{label}: UPSTREAM REUSES pending value {val} "
362
+ f"({_PENDING_BY_VALUE[val]}) as {name}"
363
+ )
364
+ for name in sorted(PENDING_UPSTREAM_STATUS & set(c_map)):
365
+ print(f"warning: pending-upstream {name} now exists upstream "
366
+ f"(= {c_map[name]}); remove it from PENDING_UPSTREAM_STATUS_TABLE",
367
+ file=sys.stderr)
336
368
 
337
369
  for name, val, comment in c_entries:
338
370
  if name not in py_entries:
@@ -346,6 +378,8 @@ def _check_enum(
346
378
  for name, val in sorted(py_entries.items(), key=lambda x: x[1]):
347
379
  if name in alias_names:
348
380
  continue
381
+ if label == "StatusType" and name in PENDING_UPSTREAM_STATUS:
382
+ continue
349
383
  if name not in c_map:
350
384
  issues.append(f"{label}: EXTRA in Python {name} = {val}")
351
385
 
@@ -0,0 +1,152 @@
1
+ """Sweep (dechirp) TLVs 118-121 and the epoch pair 216-217."""
2
+ import struct
3
+ import warnings
4
+
5
+ import pytest
6
+
7
+ from ka9q.control import encode_double, encode_int64
8
+ from ka9q.status import decode_status_packet
9
+ from ka9q.types import StatusType
10
+ from tests.test_filter_edges import _bare_control, _capture_send
11
+
12
+
13
+ def _walk(buf: bytes) -> dict:
14
+ """TLV walk -> {tag: raw value bytes}; keeps repeats out (last wins)."""
15
+ out, cp = {}, 1
16
+ while cp < len(buf):
17
+ t = buf[cp]
18
+ cp += 1
19
+ if t == StatusType.EOL:
20
+ break
21
+ n = buf[cp]
22
+ cp += 1
23
+ out[t] = buf[cp:cp + n]
24
+ cp += n
25
+ return out
26
+
27
+
28
+ def _dbl(raw: bytes) -> float:
29
+ return struct.unpack(">d", raw.rjust(8, b"\0"))[0]
30
+
31
+
32
+ def test_set_sweep_sends_four_tlvs_with_zero_start():
33
+ c = _bare_control()
34
+ sent = _capture_send(c)
35
+ c.set_sweep(12345, -25733.913, 1.0, duration_s=0.5)
36
+ tlv = _walk(sent[0])
37
+ for tag in (StatusType.SWEEP_RATE, StatusType.SWEEP_DURATION,
38
+ StatusType.SWEEP_PERIOD, StatusType.SWEEP_START):
39
+ assert tag in tlv
40
+ assert _dbl(tlv[StatusType.SWEEP_RATE]) == -25733.913
41
+ assert _dbl(tlv[StatusType.SWEEP_PERIOD]) == 1.0
42
+ assert _dbl(tlv[StatusType.SWEEP_DURATION]) == 0.5
43
+ assert tlv[StatusType.SWEEP_START] == b"" # explicit zero, zero length
44
+ assert _dbl(tlv[StatusType.SWEEP_START]) == 0.0
45
+
46
+
47
+ def test_set_sweep_duration_defaults_to_period():
48
+ c = _bare_control()
49
+ sent = _capture_send(c)
50
+ c.set_sweep(12345, 99259.4, 0.5)
51
+ tlv = _walk(sent[0])
52
+ assert _dbl(tlv[StatusType.SWEEP_DURATION]) == 0.5
53
+
54
+
55
+ def test_decode_epoch_pair():
56
+ buf = bytearray([0])
57
+ encode_double(buf, StatusType.SWEEP_RATE, -25733.913)
58
+ encode_double(buf, StatusType.SWEEP_DURATION, 1.0)
59
+ encode_double(buf, StatusType.SWEEP_PERIOD, 1.0)
60
+ encode_double(buf, StatusType.SWEEP_START, 0.25)
61
+ encode_int64(buf, StatusType.SWEEP_EPOCH_SAMPLE, 123456789012)
62
+ encode_double(buf, StatusType.SWEEP_EPOCH_FRAC, 0.375)
63
+ buf.append(StatusType.EOL)
64
+ st = decode_status_packet(bytes(buf))
65
+ assert st.sweep_rate == -25733.913
66
+ assert st.sweep_duration == 1.0
67
+ assert st.sweep_period == 1.0
68
+ assert st.sweep_start == 0.25
69
+ assert st.sweep_epoch_sample == 123456789012
70
+ assert st.sweep_epoch_frac == 0.375
71
+
72
+
73
+ def test_decode_epoch_sample_is_signed():
74
+ buf = bytearray([0])
75
+ encode_int64(buf, StatusType.SWEEP_EPOCH_SAMPLE, (-5000) & (2**64 - 1))
76
+ buf.append(StatusType.EOL)
77
+ st = decode_status_packet(bytes(buf))
78
+ assert st.sweep_epoch_sample == -5000
79
+
80
+
81
+ def test_decode_no_sweep_fields_stay_none():
82
+ st = decode_status_packet(bytes([0, StatusType.EOL]))
83
+ assert st.sweep_rate is None and st.sweep_epoch_sample is None
84
+
85
+
86
+ def test_set_doppler_is_retired():
87
+ c = _bare_control()
88
+ sent = _capture_send(c)
89
+ with warnings.catch_warnings(record=True) as w:
90
+ warnings.simplefilter("always")
91
+ with pytest.raises(RuntimeError, match="use set_sweep"):
92
+ c.set_doppler(12345, 100.0, 1.0)
93
+ assert any(issubclass(x.category, DeprecationWarning) for x in w)
94
+ assert sent == []
95
+
96
+
97
+ @pytest.mark.parametrize("kw", [
98
+ dict(rate_hz_per_s=float("nan"), period_s=1.0),
99
+ dict(rate_hz_per_s=1.0, period_s=float("inf")),
100
+ dict(rate_hz_per_s=1.0, period_s=0.0),
101
+ dict(rate_hz_per_s=1.0, period_s=-1.0),
102
+ dict(rate_hz_per_s=1.0, period_s=1e6 + 1),
103
+ dict(rate_hz_per_s=1.0, period_s=1.0, duration_s=2.0),
104
+ dict(rate_hz_per_s=1.0, period_s=1.0, duration_s=-0.1),
105
+ dict(rate_hz_per_s=1.0, period_s=1.0, start_s=float("nan")),
106
+ ])
107
+ def test_set_sweep_validates(kw):
108
+ from ka9q.exceptions import ValidationError
109
+ c = _bare_control()
110
+ sent = _capture_send(c)
111
+ with pytest.raises(ValidationError):
112
+ c.set_sweep(12345, **kw)
113
+ assert sent == []
114
+
115
+
116
+ def test_set_sweep_zero_rate_clears_without_period():
117
+ c = _bare_control()
118
+ sent = _capture_send(c)
119
+ c.set_sweep(12345, 0.0, 0.0)
120
+ assert len(sent) == 1
121
+
122
+
123
+ def test_pending_upstream_entries_exist_in_StatusType():
124
+ import importlib.util, pathlib
125
+ spec = importlib.util.spec_from_file_location(
126
+ "sync_types", pathlib.Path(__file__).parent.parent / "scripts" / "sync_types.py")
127
+ m = importlib.util.module_from_spec(spec)
128
+ spec.loader.exec_module(m)
129
+ for name, num, _ in m.PENDING_UPSTREAM_STATUS_TABLE:
130
+ assert getattr(StatusType, name) == num
131
+
132
+
133
+ def test_generator_emits_pending_entries():
134
+ import importlib.util, pathlib
135
+ spec = importlib.util.spec_from_file_location(
136
+ "sync_types", pathlib.Path(__file__).parent.parent / "scripts" / "sync_types.py")
137
+ m = importlib.util.module_from_spec(spec)
138
+ spec.loader.exec_module(m)
139
+ out = m.generate_types_py([("EOL", 0, "")], [], [], [], "0" * 40)
140
+ for name, num, _ in m.PENDING_UPSTREAM_STATUS_TABLE:
141
+ assert f" {name} = {num}" in out
142
+
143
+
144
+ def test_check_flags_upstream_reuse_of_pending_number():
145
+ import importlib.util, pathlib
146
+ spec = importlib.util.spec_from_file_location(
147
+ "sync_types", pathlib.Path(__file__).parent.parent / "scripts" / "sync_types.py")
148
+ m = importlib.util.module_from_spec(spec)
149
+ spec.loader.exec_module(m)
150
+ issues = m._check_enum("StatusType", [("SOMETHING_ELSE", 216, "")],
151
+ {"SOMETHING_ELSE": 216, "SWEEP_EPOCH_FRAC": 216})
152
+ assert any("REUSES" in i for i in issues)
File without changes
File without changes
File without changes
File without changes