oscura 0.6.0__py3-none-any.whl → 0.8.0__py3-none-any.whl
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.
- oscura/__init__.py +1 -1
- oscura/analyzers/eye/__init__.py +5 -1
- oscura/analyzers/eye/generation.py +501 -0
- oscura/analyzers/jitter/__init__.py +6 -6
- oscura/analyzers/jitter/timing.py +419 -0
- oscura/analyzers/patterns/__init__.py +28 -0
- oscura/analyzers/patterns/reverse_engineering.py +991 -0
- oscura/analyzers/power/__init__.py +35 -12
- oscura/analyzers/statistics/__init__.py +4 -0
- oscura/analyzers/statistics/basic.py +149 -0
- oscura/analyzers/statistics/correlation.py +47 -6
- oscura/analyzers/waveform/__init__.py +2 -0
- oscura/analyzers/waveform/measurements.py +145 -23
- oscura/analyzers/waveform/spectral.py +361 -8
- oscura/automotive/__init__.py +1 -1
- oscura/core/config/loader.py +0 -1
- oscura/core/types.py +108 -0
- oscura/loaders/__init__.py +12 -4
- oscura/loaders/tss.py +456 -0
- oscura/reporting/__init__.py +88 -1
- oscura/reporting/automation.py +348 -0
- oscura/reporting/citations.py +374 -0
- oscura/reporting/core.py +54 -0
- oscura/reporting/formatting/__init__.py +11 -0
- oscura/reporting/formatting/measurements.py +279 -0
- oscura/reporting/html.py +57 -0
- oscura/reporting/interpretation.py +431 -0
- oscura/reporting/summary.py +329 -0
- oscura/reporting/visualization.py +542 -0
- oscura/visualization/__init__.py +2 -1
- oscura/visualization/batch.py +521 -0
- oscura/workflows/__init__.py +2 -0
- oscura/workflows/waveform.py +783 -0
- {oscura-0.6.0.dist-info → oscura-0.8.0.dist-info}/METADATA +37 -19
- {oscura-0.6.0.dist-info → oscura-0.8.0.dist-info}/RECORD +38 -26
- {oscura-0.6.0.dist-info → oscura-0.8.0.dist-info}/WHEEL +0 -0
- {oscura-0.6.0.dist-info → oscura-0.8.0.dist-info}/entry_points.txt +0 -0
- {oscura-0.6.0.dist-info → oscura-0.8.0.dist-info}/licenses/LICENSE +0 -0
oscura/loaders/tss.py
ADDED
|
@@ -0,0 +1,456 @@
|
|
|
1
|
+
"""Tektronix Session File (.tss) Loader.
|
|
2
|
+
|
|
3
|
+
This module provides loading functionality for Tektronix session files (.tss),
|
|
4
|
+
which are ZIP archives containing multiple waveform captures, instrument
|
|
5
|
+
configuration, measurements, and annotations.
|
|
6
|
+
|
|
7
|
+
A .tss session file typically contains:
|
|
8
|
+
- Multiple .wfm waveform files (one per channel/capture)
|
|
9
|
+
- session.json: Instrument configuration and setup
|
|
10
|
+
- measurements.json: Stored measurement results (optional)
|
|
11
|
+
- annotations.json: User annotations and markers (optional)
|
|
12
|
+
|
|
13
|
+
Example:
|
|
14
|
+
>>> import oscura as osc
|
|
15
|
+
>>> trace = osc.load("oscilloscope_session.tss")
|
|
16
|
+
>>> print(f"Channel: {trace.metadata.channel_name}")
|
|
17
|
+
>>> print(f"Sample rate: {trace.metadata.sample_rate} Hz")
|
|
18
|
+
|
|
19
|
+
>>> # Load specific channel
|
|
20
|
+
>>> trace = osc.load("session.tss", channel="CH2")
|
|
21
|
+
|
|
22
|
+
>>> # Load all channels
|
|
23
|
+
>>> channels = osc.load_all_channels("session.tss")
|
|
24
|
+
>>> for name, trace in channels.items():
|
|
25
|
+
... print(f"{name}: {len(trace.data)} samples")
|
|
26
|
+
|
|
27
|
+
References:
|
|
28
|
+
Tektronix Programming Manual for Session Files
|
|
29
|
+
TekScope PC Analysis Software Documentation
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
from __future__ import annotations
|
|
33
|
+
|
|
34
|
+
import json
|
|
35
|
+
import tempfile
|
|
36
|
+
import zipfile
|
|
37
|
+
from os import PathLike
|
|
38
|
+
from pathlib import Path
|
|
39
|
+
from typing import Any
|
|
40
|
+
|
|
41
|
+
from oscura.core.exceptions import FormatError, LoaderError
|
|
42
|
+
from oscura.core.types import DigitalTrace, IQTrace, WaveformTrace
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def load_tss(
|
|
46
|
+
path: str | PathLike[str],
|
|
47
|
+
*,
|
|
48
|
+
channel: str | int | None = None,
|
|
49
|
+
) -> WaveformTrace | DigitalTrace | IQTrace:
|
|
50
|
+
"""Load a Tektronix session file (.tss).
|
|
51
|
+
|
|
52
|
+
Tektronix session files are ZIP archives containing multiple waveform
|
|
53
|
+
captures along with instrument configuration and analysis results.
|
|
54
|
+
|
|
55
|
+
Args:
|
|
56
|
+
path: Path to the Tektronix .tss session file.
|
|
57
|
+
channel: Optional channel name or index to load. If None,
|
|
58
|
+
loads the first waveform found (alphabetically).
|
|
59
|
+
String names are case-insensitive (e.g., "ch1", "CH1").
|
|
60
|
+
Integer index is 0-based.
|
|
61
|
+
|
|
62
|
+
Returns:
|
|
63
|
+
WaveformTrace, DigitalTrace, or IQTrace containing the channel data.
|
|
64
|
+
|
|
65
|
+
Raises:
|
|
66
|
+
LoaderError: If the file cannot be loaded or doesn't exist.
|
|
67
|
+
FormatError: If the file is not a valid Tektronix session.
|
|
68
|
+
|
|
69
|
+
Example:
|
|
70
|
+
>>> # Load first channel (default)
|
|
71
|
+
>>> trace = load_tss("session.tss")
|
|
72
|
+
|
|
73
|
+
>>> # Load specific channel by name
|
|
74
|
+
>>> trace = load_tss("session.tss", channel="CH2")
|
|
75
|
+
|
|
76
|
+
>>> # Load by index
|
|
77
|
+
>>> trace = load_tss("session.tss", channel=1) # Second channel
|
|
78
|
+
"""
|
|
79
|
+
path = Path(path)
|
|
80
|
+
|
|
81
|
+
# Validate file
|
|
82
|
+
_validate_tss_file(path)
|
|
83
|
+
|
|
84
|
+
# Load all waveforms and select requested channel
|
|
85
|
+
waveforms = _load_all_waveforms(path)
|
|
86
|
+
|
|
87
|
+
if not waveforms:
|
|
88
|
+
raise FormatError(
|
|
89
|
+
"No waveforms found in session file",
|
|
90
|
+
file_path=str(path),
|
|
91
|
+
expected="At least one .wfm file in the archive",
|
|
92
|
+
got="Empty session or no waveform files",
|
|
93
|
+
)
|
|
94
|
+
|
|
95
|
+
# Select channel
|
|
96
|
+
trace, channel_name = _select_channel(waveforms, channel, path)
|
|
97
|
+
|
|
98
|
+
# Enrich metadata with session information
|
|
99
|
+
try:
|
|
100
|
+
with zipfile.ZipFile(path, "r") as zf:
|
|
101
|
+
session_metadata = _parse_session_metadata(zf, path)
|
|
102
|
+
trace = _enrich_metadata_from_session(trace, session_metadata, str(path))
|
|
103
|
+
except Exception:
|
|
104
|
+
# Session metadata is optional, continue with waveform metadata
|
|
105
|
+
pass
|
|
106
|
+
|
|
107
|
+
return trace
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
def load_all_channels_tss(
|
|
111
|
+
path: Path,
|
|
112
|
+
) -> dict[str, WaveformTrace | DigitalTrace | IQTrace]:
|
|
113
|
+
"""Load all channels from a Tektronix session file.
|
|
114
|
+
|
|
115
|
+
Args:
|
|
116
|
+
path: Path to the .tss session file.
|
|
117
|
+
|
|
118
|
+
Returns:
|
|
119
|
+
Dictionary mapping channel names to traces.
|
|
120
|
+
Channel names are derived from .wfm filenames (e.g., "ch1", "ch2").
|
|
121
|
+
|
|
122
|
+
Raises:
|
|
123
|
+
LoaderError: If the file cannot be loaded.
|
|
124
|
+
FormatError: If no waveforms found in session.
|
|
125
|
+
|
|
126
|
+
Example:
|
|
127
|
+
>>> channels = load_all_channels_tss(Path("session.tss"))
|
|
128
|
+
>>> for name, trace in channels.items():
|
|
129
|
+
... print(f"{name}: {trace.metadata.sample_rate} Hz")
|
|
130
|
+
"""
|
|
131
|
+
# Validate file
|
|
132
|
+
_validate_tss_file(path)
|
|
133
|
+
|
|
134
|
+
# Load all waveforms
|
|
135
|
+
waveforms = _load_all_waveforms(path)
|
|
136
|
+
|
|
137
|
+
if not waveforms:
|
|
138
|
+
raise FormatError(
|
|
139
|
+
"No waveforms found in session file",
|
|
140
|
+
file_path=str(path),
|
|
141
|
+
expected="At least one .wfm file",
|
|
142
|
+
got="Empty archive",
|
|
143
|
+
)
|
|
144
|
+
|
|
145
|
+
# Enrich all traces with session metadata
|
|
146
|
+
try:
|
|
147
|
+
with zipfile.ZipFile(path, "r") as zf:
|
|
148
|
+
session_metadata = _parse_session_metadata(zf, path)
|
|
149
|
+
for name in waveforms:
|
|
150
|
+
waveforms[name] = _enrich_metadata_from_session(
|
|
151
|
+
waveforms[name], session_metadata, str(path)
|
|
152
|
+
)
|
|
153
|
+
except Exception:
|
|
154
|
+
# Session metadata is optional
|
|
155
|
+
pass
|
|
156
|
+
|
|
157
|
+
return waveforms
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
def _validate_tss_file(path: Path) -> None:
|
|
161
|
+
"""Validate that file exists and is a valid ZIP archive.
|
|
162
|
+
|
|
163
|
+
Args:
|
|
164
|
+
path: Path to validate.
|
|
165
|
+
|
|
166
|
+
Raises:
|
|
167
|
+
LoaderError: If file doesn't exist or can't be read.
|
|
168
|
+
FormatError: If file is not a ZIP archive.
|
|
169
|
+
"""
|
|
170
|
+
if not path.exists():
|
|
171
|
+
raise LoaderError(
|
|
172
|
+
"File not found",
|
|
173
|
+
file_path=str(path),
|
|
174
|
+
fix_hint="Ensure the file path is correct and the file exists.",
|
|
175
|
+
)
|
|
176
|
+
|
|
177
|
+
if not zipfile.is_zipfile(path):
|
|
178
|
+
raise FormatError(
|
|
179
|
+
"Not a valid ZIP archive",
|
|
180
|
+
file_path=str(path),
|
|
181
|
+
expected="Tektronix session file (.tss) is a ZIP archive",
|
|
182
|
+
got="File is not a ZIP file",
|
|
183
|
+
)
|
|
184
|
+
|
|
185
|
+
try:
|
|
186
|
+
with zipfile.ZipFile(path, "r") as zf:
|
|
187
|
+
# Test archive integrity
|
|
188
|
+
bad_file = zf.testzip()
|
|
189
|
+
if bad_file is not None:
|
|
190
|
+
raise FormatError(
|
|
191
|
+
f"Corrupted ZIP archive: {bad_file}",
|
|
192
|
+
file_path=str(path),
|
|
193
|
+
expected="Valid ZIP archive",
|
|
194
|
+
got="Corrupted file detected",
|
|
195
|
+
)
|
|
196
|
+
except zipfile.BadZipFile as e:
|
|
197
|
+
raise FormatError(
|
|
198
|
+
"Corrupted or invalid ZIP archive",
|
|
199
|
+
file_path=str(path),
|
|
200
|
+
details=str(e),
|
|
201
|
+
) from e
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
def _parse_session_metadata(zf: zipfile.ZipFile, path: Path) -> dict[str, Any]:
|
|
205
|
+
"""Parse session.json metadata from the archive.
|
|
206
|
+
|
|
207
|
+
Args:
|
|
208
|
+
zf: Open ZipFile object.
|
|
209
|
+
path: Path to session file (for error messages).
|
|
210
|
+
|
|
211
|
+
Returns:
|
|
212
|
+
Dictionary containing session metadata.
|
|
213
|
+
Returns empty dict if session.json not found (non-fatal).
|
|
214
|
+
"""
|
|
215
|
+
# Look for session metadata files
|
|
216
|
+
metadata_files = [
|
|
217
|
+
"session.json",
|
|
218
|
+
"Session.json",
|
|
219
|
+
"metadata.json",
|
|
220
|
+
"Metadata.json",
|
|
221
|
+
]
|
|
222
|
+
|
|
223
|
+
for metadata_file in metadata_files:
|
|
224
|
+
try:
|
|
225
|
+
with zf.open(metadata_file) as f:
|
|
226
|
+
data: dict[str, Any] = json.load(f)
|
|
227
|
+
return data
|
|
228
|
+
except KeyError:
|
|
229
|
+
continue
|
|
230
|
+
except json.JSONDecodeError as e:
|
|
231
|
+
# Non-fatal: log warning and continue
|
|
232
|
+
import warnings
|
|
233
|
+
|
|
234
|
+
warnings.warn(
|
|
235
|
+
f"Failed to parse {metadata_file} in {path.name}: {e}",
|
|
236
|
+
stacklevel=2,
|
|
237
|
+
)
|
|
238
|
+
return {}
|
|
239
|
+
|
|
240
|
+
# Session metadata is optional
|
|
241
|
+
return {}
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
def _extract_waveform_list(zf: zipfile.ZipFile) -> list[str]:
|
|
245
|
+
"""Extract list of .wfm files in the session.
|
|
246
|
+
|
|
247
|
+
Args:
|
|
248
|
+
zf: Open ZipFile object.
|
|
249
|
+
|
|
250
|
+
Returns:
|
|
251
|
+
List of .wfm file paths within the archive.
|
|
252
|
+
Excludes macOS metadata files (__MACOSX).
|
|
253
|
+
"""
|
|
254
|
+
return [
|
|
255
|
+
name
|
|
256
|
+
for name in zf.namelist()
|
|
257
|
+
if name.lower().endswith(".wfm") and not name.startswith("__MACOSX")
|
|
258
|
+
]
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
def _load_wfm_from_archive(
|
|
262
|
+
zf: zipfile.ZipFile,
|
|
263
|
+
wfm_name: str,
|
|
264
|
+
path: Path,
|
|
265
|
+
) -> WaveformTrace | DigitalTrace | IQTrace:
|
|
266
|
+
"""Extract and load a .wfm file from the archive.
|
|
267
|
+
|
|
268
|
+
Args:
|
|
269
|
+
zf: Open ZipFile object.
|
|
270
|
+
wfm_name: Name of .wfm file within archive.
|
|
271
|
+
path: Path to session file (for error messages).
|
|
272
|
+
|
|
273
|
+
Returns:
|
|
274
|
+
Loaded trace from the waveform file.
|
|
275
|
+
|
|
276
|
+
Raises:
|
|
277
|
+
LoaderError: If waveform cannot be loaded.
|
|
278
|
+
"""
|
|
279
|
+
try:
|
|
280
|
+
# Extract waveform to temporary file
|
|
281
|
+
# (load_tektronix_wfm expects file path, not bytes)
|
|
282
|
+
wfm_bytes = zf.read(wfm_name)
|
|
283
|
+
|
|
284
|
+
with tempfile.NamedTemporaryFile(suffix=".wfm", delete=True) as tmp:
|
|
285
|
+
tmp.write(wfm_bytes)
|
|
286
|
+
tmp.flush()
|
|
287
|
+
|
|
288
|
+
# Use existing Tektronix loader
|
|
289
|
+
from oscura.loaders.tektronix import load_tektronix_wfm
|
|
290
|
+
|
|
291
|
+
trace = load_tektronix_wfm(tmp.name)
|
|
292
|
+
|
|
293
|
+
return trace
|
|
294
|
+
|
|
295
|
+
except Exception as e:
|
|
296
|
+
raise LoaderError(
|
|
297
|
+
f"Failed to load waveform from session: {wfm_name}",
|
|
298
|
+
file_path=str(path),
|
|
299
|
+
details=str(e),
|
|
300
|
+
fix_hint="Waveform file may be corrupted or incompatible.",
|
|
301
|
+
) from e
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
def _load_all_waveforms(path: Path) -> dict[str, WaveformTrace | DigitalTrace | IQTrace]:
|
|
305
|
+
"""Load all waveforms from the session file.
|
|
306
|
+
|
|
307
|
+
Args:
|
|
308
|
+
path: Path to .tss session file.
|
|
309
|
+
|
|
310
|
+
Returns:
|
|
311
|
+
Dictionary mapping channel names to traces.
|
|
312
|
+
"""
|
|
313
|
+
waveforms: dict[str, WaveformTrace | DigitalTrace | IQTrace] = {}
|
|
314
|
+
|
|
315
|
+
with zipfile.ZipFile(path, "r") as zf:
|
|
316
|
+
wfm_files = _extract_waveform_list(zf)
|
|
317
|
+
|
|
318
|
+
for wfm_name in sorted(wfm_files): # Sort for consistent ordering
|
|
319
|
+
# Derive channel name from filename
|
|
320
|
+
channel_name = _derive_channel_name(wfm_name)
|
|
321
|
+
|
|
322
|
+
# Load waveform
|
|
323
|
+
trace = _load_wfm_from_archive(zf, wfm_name, path)
|
|
324
|
+
|
|
325
|
+
# Store with normalized channel name
|
|
326
|
+
waveforms[channel_name] = trace
|
|
327
|
+
|
|
328
|
+
return waveforms
|
|
329
|
+
|
|
330
|
+
|
|
331
|
+
def _derive_channel_name(wfm_filename: str) -> str:
|
|
332
|
+
"""Derive channel name from .wfm filename.
|
|
333
|
+
|
|
334
|
+
Args:
|
|
335
|
+
wfm_filename: Filename like "CH1.wfm", "CH2_Voltage.wfm", etc.
|
|
336
|
+
|
|
337
|
+
Returns:
|
|
338
|
+
Normalized channel name (lowercase, e.g., "ch1", "ch2", "d0").
|
|
339
|
+
|
|
340
|
+
Examples:
|
|
341
|
+
>>> _derive_channel_name("CH1.wfm")
|
|
342
|
+
'ch1'
|
|
343
|
+
>>> _derive_channel_name("subdir/CH2_Voltage.wfm")
|
|
344
|
+
'ch2'
|
|
345
|
+
>>> _derive_channel_name("D0.wfm")
|
|
346
|
+
'd0'
|
|
347
|
+
>>> _derive_channel_name("MATH1.wfm")
|
|
348
|
+
'math1'
|
|
349
|
+
"""
|
|
350
|
+
# Get base filename without path
|
|
351
|
+
basename = Path(wfm_filename).stem # Remove extension
|
|
352
|
+
|
|
353
|
+
# Remove path components if nested
|
|
354
|
+
basename = basename.split("/")[-1].split("\\")[-1]
|
|
355
|
+
|
|
356
|
+
# Extract channel identifier (first part before underscore)
|
|
357
|
+
channel_id = basename.split("_")[0]
|
|
358
|
+
|
|
359
|
+
# Normalize to lowercase
|
|
360
|
+
return channel_id.lower()
|
|
361
|
+
|
|
362
|
+
|
|
363
|
+
def _select_channel(
|
|
364
|
+
waveforms: dict[str, WaveformTrace | DigitalTrace | IQTrace],
|
|
365
|
+
channel: str | int | None,
|
|
366
|
+
path: Path,
|
|
367
|
+
) -> tuple[WaveformTrace | DigitalTrace | IQTrace, str]:
|
|
368
|
+
"""Select specific channel from waveforms dictionary.
|
|
369
|
+
|
|
370
|
+
Args:
|
|
371
|
+
waveforms: Dictionary of channel name to trace.
|
|
372
|
+
channel: Channel selector (name, index, or None for first).
|
|
373
|
+
path: Path to session file (for error messages).
|
|
374
|
+
|
|
375
|
+
Returns:
|
|
376
|
+
Tuple of (selected_trace, channel_name).
|
|
377
|
+
|
|
378
|
+
Raises:
|
|
379
|
+
LoaderError: If channel not found or index out of range.
|
|
380
|
+
"""
|
|
381
|
+
if channel is None:
|
|
382
|
+
# Default: first channel (alphabetically sorted)
|
|
383
|
+
channel_name = sorted(waveforms.keys())[0]
|
|
384
|
+
return waveforms[channel_name], channel_name
|
|
385
|
+
|
|
386
|
+
if isinstance(channel, int):
|
|
387
|
+
# Select by index
|
|
388
|
+
channel_names = sorted(waveforms.keys())
|
|
389
|
+
if channel < 0 or channel >= len(channel_names):
|
|
390
|
+
raise LoaderError(
|
|
391
|
+
f"Channel index {channel} out of range",
|
|
392
|
+
file_path=str(path),
|
|
393
|
+
fix_hint=f"Available channels: {', '.join(channel_names)} (indices 0-{len(channel_names) - 1})",
|
|
394
|
+
)
|
|
395
|
+
channel_name = channel_names[channel]
|
|
396
|
+
return waveforms[channel_name], channel_name
|
|
397
|
+
|
|
398
|
+
# Select by name (case-insensitive)
|
|
399
|
+
channel_lower = channel.lower()
|
|
400
|
+
for name, trace in waveforms.items():
|
|
401
|
+
if name.lower() == channel_lower:
|
|
402
|
+
return trace, name
|
|
403
|
+
|
|
404
|
+
# Channel not found
|
|
405
|
+
available = ", ".join(sorted(waveforms.keys()))
|
|
406
|
+
raise LoaderError(
|
|
407
|
+
f"Channel '{channel}' not found in session",
|
|
408
|
+
file_path=str(path),
|
|
409
|
+
fix_hint=f"Available channels: {available}",
|
|
410
|
+
)
|
|
411
|
+
|
|
412
|
+
|
|
413
|
+
def _enrich_metadata_from_session(
|
|
414
|
+
trace: WaveformTrace | DigitalTrace | IQTrace,
|
|
415
|
+
session_metadata: dict[str, Any],
|
|
416
|
+
source_file: str,
|
|
417
|
+
) -> WaveformTrace | DigitalTrace | IQTrace:
|
|
418
|
+
"""Enrich waveform metadata with session-level information.
|
|
419
|
+
|
|
420
|
+
Args:
|
|
421
|
+
trace: Original trace from .wfm file.
|
|
422
|
+
session_metadata: Session metadata from session.json.
|
|
423
|
+
source_file: Path to .tss file (for source_file metadata).
|
|
424
|
+
|
|
425
|
+
Returns:
|
|
426
|
+
Trace with enriched metadata.
|
|
427
|
+
"""
|
|
428
|
+
# Create new metadata with session information
|
|
429
|
+
from dataclasses import replace
|
|
430
|
+
|
|
431
|
+
metadata = trace.metadata
|
|
432
|
+
|
|
433
|
+
# Update source file to point to .tss instead of temp .wfm
|
|
434
|
+
metadata = replace(metadata, source_file=source_file)
|
|
435
|
+
|
|
436
|
+
# Add trigger info from session if available
|
|
437
|
+
if "trigger" in session_metadata and metadata.trigger_info is None:
|
|
438
|
+
metadata = replace(metadata, trigger_info=session_metadata["trigger"])
|
|
439
|
+
|
|
440
|
+
# Return trace with updated metadata
|
|
441
|
+
if isinstance(trace, WaveformTrace):
|
|
442
|
+
return WaveformTrace(data=trace.data, metadata=metadata)
|
|
443
|
+
if isinstance(trace, DigitalTrace):
|
|
444
|
+
return DigitalTrace(data=trace.data, metadata=metadata, edges=trace.edges)
|
|
445
|
+
# IQTrace
|
|
446
|
+
return IQTrace(
|
|
447
|
+
i_data=trace.i_data,
|
|
448
|
+
q_data=trace.q_data,
|
|
449
|
+
metadata=metadata,
|
|
450
|
+
)
|
|
451
|
+
|
|
452
|
+
|
|
453
|
+
__all__ = [
|
|
454
|
+
"load_all_channels_tss",
|
|
455
|
+
"load_tss",
|
|
456
|
+
]
|
oscura/reporting/__init__.py
CHANGED
|
@@ -18,6 +18,12 @@ from oscura.reporting.auto_report import (
|
|
|
18
18
|
from oscura.reporting.auto_report import (
|
|
19
19
|
generate_report as generate_auto_report,
|
|
20
20
|
)
|
|
21
|
+
from oscura.reporting.automation import (
|
|
22
|
+
auto_interpret_results,
|
|
23
|
+
flag_anomalies,
|
|
24
|
+
identify_issues,
|
|
25
|
+
suggest_follow_up_analyses,
|
|
26
|
+
)
|
|
21
27
|
from oscura.reporting.batch import (
|
|
22
28
|
BatchReportResult,
|
|
23
29
|
aggregate_batch_measurements,
|
|
@@ -30,6 +36,13 @@ from oscura.reporting.chart_selection import (
|
|
|
30
36
|
get_axis_scaling,
|
|
31
37
|
recommend_chart_with_reasoning,
|
|
32
38
|
)
|
|
39
|
+
from oscura.reporting.citations import (
|
|
40
|
+
Citation,
|
|
41
|
+
CitationManager,
|
|
42
|
+
auto_cite_measurement,
|
|
43
|
+
get_standard_info,
|
|
44
|
+
list_available_standards,
|
|
45
|
+
)
|
|
33
46
|
from oscura.reporting.comparison import (
|
|
34
47
|
compare_waveforms,
|
|
35
48
|
generate_comparison_report,
|
|
@@ -73,8 +86,12 @@ from oscura.reporting.export import (
|
|
|
73
86
|
export_report,
|
|
74
87
|
)
|
|
75
88
|
from oscura.reporting.formatting import (
|
|
89
|
+
MeasurementFormatter,
|
|
76
90
|
NumberFormatter,
|
|
91
|
+
convert_to_measurement_dict,
|
|
77
92
|
format_margin,
|
|
93
|
+
format_measurement,
|
|
94
|
+
format_measurement_dict,
|
|
78
95
|
format_pass_fail,
|
|
79
96
|
format_value,
|
|
80
97
|
format_with_context,
|
|
@@ -82,6 +99,7 @@ from oscura.reporting.formatting import (
|
|
|
82
99
|
format_with_units,
|
|
83
100
|
)
|
|
84
101
|
from oscura.reporting.html import (
|
|
102
|
+
embed_plots,
|
|
85
103
|
generate_html_report,
|
|
86
104
|
save_html_report,
|
|
87
105
|
)
|
|
@@ -89,6 +107,16 @@ from oscura.reporting.index import (
|
|
|
89
107
|
IndexGenerator,
|
|
90
108
|
TemplateEngine,
|
|
91
109
|
)
|
|
110
|
+
from oscura.reporting.interpretation import (
|
|
111
|
+
ComplianceStatus,
|
|
112
|
+
MeasurementInterpretation,
|
|
113
|
+
QualityLevel,
|
|
114
|
+
compliance_check,
|
|
115
|
+
generate_finding,
|
|
116
|
+
interpret_measurement,
|
|
117
|
+
interpret_results_batch,
|
|
118
|
+
quality_score,
|
|
119
|
+
)
|
|
92
120
|
from oscura.reporting.multichannel import (
|
|
93
121
|
generate_multichannel_report,
|
|
94
122
|
)
|
|
@@ -127,6 +155,12 @@ from oscura.reporting.standards import (
|
|
|
127
155
|
format_executive_summary_html,
|
|
128
156
|
generate_executive_summary,
|
|
129
157
|
)
|
|
158
|
+
from oscura.reporting.summary import (
|
|
159
|
+
ExecutiveSummarySection,
|
|
160
|
+
identify_key_findings,
|
|
161
|
+
recommendations_from_findings,
|
|
162
|
+
summarize_measurements,
|
|
163
|
+
)
|
|
130
164
|
from oscura.reporting.summary_generator import (
|
|
131
165
|
Finding,
|
|
132
166
|
Summary,
|
|
@@ -144,6 +178,10 @@ from oscura.reporting.template_system import (
|
|
|
144
178
|
list_templates,
|
|
145
179
|
load_template,
|
|
146
180
|
)
|
|
181
|
+
from oscura.reporting.visualization import (
|
|
182
|
+
IEEEPlotGenerator,
|
|
183
|
+
PlotStyler,
|
|
184
|
+
)
|
|
147
185
|
|
|
148
186
|
__all__ = [
|
|
149
187
|
# Comprehensive Analysis Report API (CAR-001 through CAR-007)
|
|
@@ -160,30 +198,46 @@ __all__ = [
|
|
|
160
198
|
"BatchReportResult",
|
|
161
199
|
# Chart Selection (REPORT-028)
|
|
162
200
|
"ChartType",
|
|
201
|
+
# Citations (NEW)
|
|
202
|
+
"Citation",
|
|
203
|
+
"CitationManager",
|
|
163
204
|
# Standards (REPORT-001, REPORT-002, REPORT-004)
|
|
164
205
|
"ColorScheme",
|
|
206
|
+
# Compliance (NEW)
|
|
207
|
+
"ComplianceStatus",
|
|
165
208
|
"DataOutputConfig",
|
|
166
209
|
"DomainConfig",
|
|
167
210
|
# Enhanced Reports (Feature 6)
|
|
168
211
|
"EnhancedReportConfig",
|
|
169
212
|
"EnhancedReportGenerator",
|
|
170
213
|
"ExecutiveSummary",
|
|
214
|
+
# Executive Summary (NEW)
|
|
215
|
+
"ExecutiveSummarySection",
|
|
171
216
|
# Summary Generation
|
|
172
217
|
"Finding",
|
|
173
218
|
"FormatStandards",
|
|
219
|
+
# IEEE Visualization (NEW)
|
|
220
|
+
"IEEEPlotGenerator",
|
|
174
221
|
"IndexGenerator",
|
|
175
222
|
"InputType",
|
|
223
|
+
# Formatting (REPORT-026)
|
|
224
|
+
"MeasurementFormatter",
|
|
225
|
+
# Measurement Interpretation (NEW)
|
|
226
|
+
"MeasurementInterpretation",
|
|
176
227
|
# Multi-format (REPORT-010)
|
|
177
228
|
"MultiFormatRenderer",
|
|
178
|
-
# Formatting (REPORT-026)
|
|
179
229
|
"NumberFormatter",
|
|
180
230
|
"OutputManager",
|
|
181
231
|
# PPTX Export (REPORT-023)
|
|
182
232
|
"PPTXPresentation",
|
|
183
233
|
"PPTXSlide",
|
|
184
234
|
"PlotGenerator",
|
|
235
|
+
# Plot Styling (NEW)
|
|
236
|
+
"PlotStyler",
|
|
185
237
|
"ProgressCallback",
|
|
186
238
|
"ProgressInfo",
|
|
239
|
+
# Quality Assessment (NEW)
|
|
240
|
+
"QualityLevel",
|
|
187
241
|
# Core
|
|
188
242
|
"Report",
|
|
189
243
|
"ReportConfig",
|
|
@@ -199,12 +253,18 @@ __all__ = [
|
|
|
199
253
|
"VisualEmphasis",
|
|
200
254
|
"aggregate_batch_measurements",
|
|
201
255
|
"analyze",
|
|
256
|
+
# Automation (NEW)
|
|
257
|
+
"auto_cite_measurement",
|
|
258
|
+
"auto_interpret_results",
|
|
202
259
|
"auto_select_chart",
|
|
203
260
|
# Export
|
|
204
261
|
"batch_export_formats",
|
|
205
262
|
"batch_report",
|
|
206
263
|
# Comparison
|
|
207
264
|
"compare_waveforms",
|
|
265
|
+
# Compliance (NEW)
|
|
266
|
+
"compliance_check",
|
|
267
|
+
"convert_to_measurement_dict",
|
|
208
268
|
# Tables
|
|
209
269
|
"create_comparison_table",
|
|
210
270
|
# Sections
|
|
@@ -220,12 +280,18 @@ __all__ = [
|
|
|
220
280
|
"create_violations_section",
|
|
221
281
|
# Multi-format (REPORT-010)
|
|
222
282
|
"detect_format_from_extension",
|
|
283
|
+
# HTML Generation
|
|
284
|
+
"embed_plots",
|
|
223
285
|
"export_multiple_reports",
|
|
224
286
|
"export_pptx",
|
|
225
287
|
"export_report",
|
|
288
|
+
# Anomaly Detection (NEW)
|
|
289
|
+
"flag_anomalies",
|
|
226
290
|
"format_batch_summary_table",
|
|
227
291
|
"format_executive_summary_html",
|
|
228
292
|
"format_margin",
|
|
293
|
+
"format_measurement",
|
|
294
|
+
"format_measurement_dict",
|
|
229
295
|
"format_pass_fail",
|
|
230
296
|
"format_value",
|
|
231
297
|
"format_with_context",
|
|
@@ -235,6 +301,8 @@ __all__ = [
|
|
|
235
301
|
"generate_batch_report",
|
|
236
302
|
"generate_comparison_report",
|
|
237
303
|
"generate_executive_summary",
|
|
304
|
+
# Findings (NEW)
|
|
305
|
+
"generate_finding",
|
|
238
306
|
# HTML Generation
|
|
239
307
|
"generate_html_report",
|
|
240
308
|
# Multi-Channel
|
|
@@ -246,12 +314,31 @@ __all__ = [
|
|
|
246
314
|
"generate_summary",
|
|
247
315
|
"get_available_analyses",
|
|
248
316
|
"get_axis_scaling",
|
|
317
|
+
# Citations (NEW)
|
|
318
|
+
"get_standard_info",
|
|
319
|
+
# Issue Identification (NEW)
|
|
320
|
+
"identify_issues",
|
|
321
|
+
# Key Findings (NEW)
|
|
322
|
+
"identify_key_findings",
|
|
323
|
+
# Interpretation (NEW)
|
|
324
|
+
"interpret_measurement",
|
|
325
|
+
"interpret_results_batch",
|
|
326
|
+
# Standards (NEW)
|
|
327
|
+
"list_available_standards",
|
|
249
328
|
"list_templates",
|
|
250
329
|
"load_template",
|
|
330
|
+
# Quality (NEW)
|
|
331
|
+
"quality_score",
|
|
251
332
|
"recommend_chart_with_reasoning",
|
|
333
|
+
# Recommendations (NEW)
|
|
334
|
+
"recommendations_from_findings",
|
|
252
335
|
"register_plot",
|
|
253
336
|
# Multi-format (REPORT-010)
|
|
254
337
|
"render_all_formats",
|
|
255
338
|
"save_html_report",
|
|
256
339
|
"save_pdf_report",
|
|
340
|
+
# Follow-up Analysis (NEW)
|
|
341
|
+
"suggest_follow_up_analyses",
|
|
342
|
+
# Summary (NEW)
|
|
343
|
+
"summarize_measurements",
|
|
257
344
|
]
|