slm_open_api_package 0.2.13__tar.gz → 0.2.14__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.
- {slm_open_api_package-0.2.13 → slm_open_api_package-0.2.14}/PKG-INFO +3 -1
- {slm_open_api_package-0.2.13 → slm_open_api_package-0.2.14}/README.md +2 -0
- {slm_open_api_package-0.2.13 → slm_open_api_package-0.2.14}/pyproject.toml +1 -1
- {slm_open_api_package-0.2.13 → slm_open_api_package-0.2.14}/pyproject.toml.orig +1 -1
- {slm_open_api_package-0.2.13 → slm_open_api_package-0.2.14}/src/slm_api/helpers/data_handler.py +11 -0
- {slm_open_api_package-0.2.13 → slm_open_api_package-0.2.14}/src/slm_api/helpers/stream_handlers.py +5 -3
- {slm_open_api_package-0.2.13 → slm_open_api_package-0.2.14}/src/slm_api/CPB_example.py +0 -0
- {slm_open_api_package-0.2.13 → slm_open_api_package-0.2.14}/src/slm_api/__init__.py +0 -0
- {slm_open_api_package-0.2.13 → slm_open_api_package-0.2.14}/src/slm_api/enums/fast_log_intervals_enum.py +0 -0
- {slm_open_api_package-0.2.13 → slm_open_api_package-0.2.14}/src/slm_api/enums/sequence_id_enum.py +0 -0
- {slm_open_api_package-0.2.13 → slm_open_api_package-0.2.14}/src/slm_api/example_multi.py +0 -0
- {slm_open_api_package-0.2.13 → slm_open_api_package-0.2.14}/src/slm_api/fast_log_example.py +0 -0
- {slm_open_api_package-0.2.13 → slm_open_api_package-0.2.14}/src/slm_api/flac_example.py +0 -0
- {slm_open_api_package-0.2.13 → slm_open_api_package-0.2.14}/src/slm_api/helpers/FigureHandler.py +0 -0
- {slm_open_api_package-0.2.13 → slm_open_api_package-0.2.14}/src/slm_api/helpers/Leq.py +0 -0
- {slm_open_api_package-0.2.13 → slm_open_api_package-0.2.14}/src/slm_api/helpers/__init__.py +0 -0
- {slm_open_api_package-0.2.13 → slm_open_api_package-0.2.14}/src/slm_api/helpers/buffer.py +0 -0
- {slm_open_api_package-0.2.13 → slm_open_api_package-0.2.14}/src/slm_api/helpers/fft.py +0 -0
- {slm_open_api_package-0.2.13 → slm_open_api_package-0.2.14}/src/slm_api/helpers/flac_stream_2_samples.py +0 -0
- {slm_open_api_package-0.2.13 → slm_open_api_package-0.2.14}/src/slm_api/helpers/https_requests.py +0 -0
- {slm_open_api_package-0.2.13 → slm_open_api_package-0.2.14}/src/slm_api/helpers/measurment_handler.py +0 -0
- {slm_open_api_package-0.2.13 → slm_open_api_package-0.2.14}/src/slm_api/helpers/sequence_handler.py +0 -0
- {slm_open_api_package-0.2.13 → slm_open_api_package-0.2.14}/src/slm_api/helpers/stream_handler.py +0 -0
- {slm_open_api_package-0.2.13 → slm_open_api_package-0.2.14}/src/slm_api/helpers/tmpFileStateMachine.py +0 -0
- {slm_open_api_package-0.2.13 → slm_open_api_package-0.2.14}/src/slm_api/helpers/websocket_handler.py +0 -0
- {slm_open_api_package-0.2.13 → slm_open_api_package-0.2.14}/src/slm_api/helpers/webxi_helper_functions.py +0 -0
- {slm_open_api_package-0.2.13 → slm_open_api_package-0.2.14}/src/slm_api/helpers/webxi_root.pem +0 -0
- {slm_open_api_package-0.2.13 → slm_open_api_package-0.2.14}/src/slm_api/leq.py +0 -0
- {slm_open_api_package-0.2.13 → slm_open_api_package-0.2.14}/src/slm_api/mp3_example.py +0 -0
- {slm_open_api_package-0.2.13 → slm_open_api_package-0.2.14}/src/slm_api/multi_device_flac.py +0 -0
- {slm_open_api_package-0.2.13 → slm_open_api_package-0.2.14}/src/slm_api/multi_instrument_example.py +0 -0
- {slm_open_api_package-0.2.13 → slm_open_api_package-0.2.14}/src/slm_api/plot_saved_data_example.py +0 -0
- {slm_open_api_package-0.2.13 → slm_open_api_package-0.2.14}/src/slm_api/screen_record_example.py +0 -0
- {slm_open_api_package-0.2.13 → slm_open_api_package-0.2.14}/src/slm_api/webxi/README.md +0 -0
- {slm_open_api_package-0.2.13 → slm_open_api_package-0.2.14}/src/slm_api/webxi/__init__.py +0 -0
- {slm_open_api_package-0.2.13 → slm_open_api_package-0.2.14}/src/slm_api/webxi/webxi-header.ksy +0 -0
- {slm_open_api_package-0.2.13 → slm_open_api_package-0.2.14}/src/slm_api/webxi/webxi-stream.ksy +0 -0
- {slm_open_api_package-0.2.13 → slm_open_api_package-0.2.14}/src/slm_api/webxi/webxi_header.py +0 -0
- {slm_open_api_package-0.2.13 → slm_open_api_package-0.2.14}/src/slm_api/webxi/webxi_stream.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: slm_open_api_package
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.14
|
|
4
4
|
Summary: Add your description here
|
|
5
5
|
Author: Sofus Vingaard
|
|
6
6
|
Author-email: Sofus Vingaard <sofus.krebsvingaard@hbkworld.com>
|
|
@@ -82,6 +82,8 @@ except KeyboardInterrupt:
|
|
|
82
82
|
|
|
83
83
|
JSON and CSV publish complete snapshots in a background worker, at most once per second while new data arrives, rather than rewriting the file for every sample. They retain records in memory and preserve their existing layouts; full-history snapshot costs still grow with recording length. Construct `JsonDataHandler(path, snapshot_interval=2.0)` or `CsvDataHandler(path, snapshot_interval=2.0)` and attach it with `setDataHandler()` to use a different interval. `close()` waits for the worker and saves all remaining records; background write failures are reported on subsequent updates or during the final flush. WAV still appends each audio chunk without buffering the recording in memory. `stopStream()` stops the measurement, closes saving handlers, and removes the device stream. Measurement saving formats are `"csv"` and `"json"`; audio uses `"wav"`. File extensions are added automatically.
|
|
84
84
|
|
|
85
|
+
If snapshot replacement raises `PermissionError` (for example, Windows prevents replacing a CSV open in Excel), the worker warns once per failure episode, continues buffering records, and retries at the next snapshot interval. Close the program holding the output file open, or correct its permissions, to allow saving to resume. A lock still present at `close()` raises an error; unsaved records only remain in memory while the process is alive. Other write failures remain fatal to snapshot saving. `stopStream()` still attempts device cleanup if closing the saving handler fails.
|
|
86
|
+
|
|
85
87
|
## Multiple Sequences
|
|
86
88
|
|
|
87
89
|
Based on [example_multi.py](src/slm_api/example_multi.py), use `mode="multi"` for several enabled broadband sequences in a single stream:
|
|
@@ -60,6 +60,8 @@ except KeyboardInterrupt:
|
|
|
60
60
|
|
|
61
61
|
JSON and CSV publish complete snapshots in a background worker, at most once per second while new data arrives, rather than rewriting the file for every sample. They retain records in memory and preserve their existing layouts; full-history snapshot costs still grow with recording length. Construct `JsonDataHandler(path, snapshot_interval=2.0)` or `CsvDataHandler(path, snapshot_interval=2.0)` and attach it with `setDataHandler()` to use a different interval. `close()` waits for the worker and saves all remaining records; background write failures are reported on subsequent updates or during the final flush. WAV still appends each audio chunk without buffering the recording in memory. `stopStream()` stops the measurement, closes saving handlers, and removes the device stream. Measurement saving formats are `"csv"` and `"json"`; audio uses `"wav"`. File extensions are added automatically.
|
|
62
62
|
|
|
63
|
+
If snapshot replacement raises `PermissionError` (for example, Windows prevents replacing a CSV open in Excel), the worker warns once per failure episode, continues buffering records, and retries at the next snapshot interval. Close the program holding the output file open, or correct its permissions, to allow saving to resume. A lock still present at `close()` raises an error; unsaved records only remain in memory while the process is alive. Other write failures remain fatal to snapshot saving. `stopStream()` still attempts device cleanup if closing the saving handler fails.
|
|
64
|
+
|
|
63
65
|
## Multiple Sequences
|
|
64
66
|
|
|
65
67
|
Based on [example_multi.py](src/slm_api/example_multi.py), use `mode="multi"` for several enabled broadband sequences in a single stream:
|
{slm_open_api_package-0.2.13 → slm_open_api_package-0.2.14}/src/slm_api/helpers/data_handler.py
RENAMED
|
@@ -70,9 +70,20 @@ class _BufferedFileDataHandler(DataHandler):
|
|
|
70
70
|
self._worker.start()
|
|
71
71
|
|
|
72
72
|
def _run_snapshots(self):
|
|
73
|
+
permission_error_reported = False
|
|
73
74
|
while not self._stop_event.wait(self._snapshot_interval):
|
|
74
75
|
try:
|
|
75
76
|
self._flush_snapshot()
|
|
77
|
+
permission_error_reported = False
|
|
78
|
+
except PermissionError as error:
|
|
79
|
+
if not permission_error_reported:
|
|
80
|
+
warnings.warn(
|
|
81
|
+
f"Cannot replace snapshot {self._path}: {error}. "
|
|
82
|
+
"Close any program holding the file open. Records remain "
|
|
83
|
+
"buffered in memory and saving will retry automatically.",
|
|
84
|
+
RuntimeWarning,
|
|
85
|
+
)
|
|
86
|
+
permission_error_reported = True
|
|
76
87
|
except Exception as error:
|
|
77
88
|
with self._lock:
|
|
78
89
|
self._write_error = error
|
{slm_open_api_package-0.2.13 → slm_open_api_package-0.2.14}/src/slm_api/helpers/stream_handlers.py
RENAMED
|
@@ -482,6 +482,8 @@ class WebXiStreamHandler(stream.StreamHandler):
|
|
|
482
482
|
print(f"TotalTime: {total}")
|
|
483
483
|
|
|
484
484
|
def stopStream(self):
|
|
485
|
-
|
|
486
|
-
self.data_handler.close
|
|
487
|
-
|
|
485
|
+
try:
|
|
486
|
+
if self.data_handler is not None and hasattr(self.data_handler, "close"):
|
|
487
|
+
self.data_handler.close()
|
|
488
|
+
finally:
|
|
489
|
+
super().stopStream()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{slm_open_api_package-0.2.13 → slm_open_api_package-0.2.14}/src/slm_api/enums/sequence_id_enum.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{slm_open_api_package-0.2.13 → slm_open_api_package-0.2.14}/src/slm_api/helpers/FigureHandler.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{slm_open_api_package-0.2.13 → slm_open_api_package-0.2.14}/src/slm_api/helpers/https_requests.py
RENAMED
|
File without changes
|
|
File without changes
|
{slm_open_api_package-0.2.13 → slm_open_api_package-0.2.14}/src/slm_api/helpers/sequence_handler.py
RENAMED
|
File without changes
|
{slm_open_api_package-0.2.13 → slm_open_api_package-0.2.14}/src/slm_api/helpers/stream_handler.py
RENAMED
|
File without changes
|
|
File without changes
|
{slm_open_api_package-0.2.13 → slm_open_api_package-0.2.14}/src/slm_api/helpers/websocket_handler.py
RENAMED
|
File without changes
|
|
File without changes
|
{slm_open_api_package-0.2.13 → slm_open_api_package-0.2.14}/src/slm_api/helpers/webxi_root.pem
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{slm_open_api_package-0.2.13 → slm_open_api_package-0.2.14}/src/slm_api/multi_device_flac.py
RENAMED
|
File without changes
|
{slm_open_api_package-0.2.13 → slm_open_api_package-0.2.14}/src/slm_api/multi_instrument_example.py
RENAMED
|
File without changes
|
{slm_open_api_package-0.2.13 → slm_open_api_package-0.2.14}/src/slm_api/plot_saved_data_example.py
RENAMED
|
File without changes
|
{slm_open_api_package-0.2.13 → slm_open_api_package-0.2.14}/src/slm_api/screen_record_example.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{slm_open_api_package-0.2.13 → slm_open_api_package-0.2.14}/src/slm_api/webxi/webxi-header.ksy
RENAMED
|
File without changes
|
{slm_open_api_package-0.2.13 → slm_open_api_package-0.2.14}/src/slm_api/webxi/webxi-stream.ksy
RENAMED
|
File without changes
|
{slm_open_api_package-0.2.13 → slm_open_api_package-0.2.14}/src/slm_api/webxi/webxi_header.py
RENAMED
|
File without changes
|
{slm_open_api_package-0.2.13 → slm_open_api_package-0.2.14}/src/slm_api/webxi/webxi_stream.py
RENAMED
|
File without changes
|