oscura 0.1.0__py3-none-any.whl → 0.1.1__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 +14 -14
- oscura/__main__.py +9 -9
- oscura/analyzers/__init__.py +1 -1
- oscura/analyzers/packet/daq.py +1 -1
- oscura/analyzers/patterns/__init__.py +2 -2
- oscura/analyzers/patterns/clustering.py +1 -1
- oscura/analyzers/patterns/discovery.py +1 -1
- oscura/analyzers/patterns/periodic.py +1 -1
- oscura/analyzers/patterns/sequences.py +1 -1
- oscura/analyzers/power/__init__.py +1 -1
- oscura/analyzers/power/ac_power.py +1 -1
- oscura/analyzers/power/basic.py +1 -1
- oscura/analyzers/power/conduction.py +1 -1
- oscura/analyzers/power/efficiency.py +1 -1
- oscura/analyzers/power/ripple.py +1 -1
- oscura/analyzers/power/soa.py +1 -1
- oscura/analyzers/power/switching.py +1 -1
- oscura/api/__init__.py +1 -1
- oscura/automotive/__init__.py +1 -1
- oscura/automotive/can/checksum.py +2 -2
- oscura/automotive/can/session.py +1 -1
- oscura/automotive/can/state_machine.py +1 -1
- oscura/automotive/dbc/generator.py +1 -1
- oscura/automotive/dbc/parser.py +1 -1
- oscura/automotive/loaders/pcap.py +1 -1
- oscura/batch/__init__.py +1 -1
- oscura/batch/aggregate.py +2 -2
- oscura/batch/analyze.py +3 -3
- oscura/builders/__init__.py +7 -7
- oscura/builders/signal_builder.py +4 -4
- oscura/cli/__init__.py +1 -1
- oscura/cli/batch.py +1 -1
- oscura/cli/characterize.py +2 -2
- oscura/cli/compare.py +4 -4
- oscura/cli/decode.py +1 -1
- oscura/cli/main.py +8 -8
- oscura/cli/shell.py +19 -19
- oscura/comparison/__init__.py +1 -1
- oscura/comparison/compare.py +1 -1
- oscura/comparison/golden.py +1 -1
- oscura/comparison/limits.py +1 -1
- oscura/comparison/mask.py +1 -1
- oscura/comparison/trace_diff.py +1 -1
- oscura/compliance/__init__.py +2 -2
- oscura/compliance/reporting.py +2 -2
- oscura/component/__init__.py +1 -1
- oscura/component/impedance.py +1 -1
- oscura/component/reactive.py +1 -1
- oscura/component/transmission_line.py +1 -1
- oscura/config/__init__.py +1 -1
- oscura/config/loader.py +1 -1
- oscura/config/memory.py +3 -3
- oscura/config/migration.py +1 -1
- oscura/config/preferences.py +1 -1
- oscura/config/schema.py +3 -3
- oscura/config/settings.py +1 -1
- oscura/convenience.py +13 -13
- oscura/core/__init__.py +6 -6
- oscura/core/cache.py +10 -10
- oscura/core/cancellation.py +1 -1
- oscura/core/confidence.py +1 -1
- oscura/core/config.py +1 -1
- oscura/core/correlation.py +1 -1
- oscura/core/debug.py +4 -4
- oscura/core/edge_cases.py +1 -1
- oscura/core/exceptions.py +14 -14
- oscura/core/gpu_backend.py +5 -5
- oscura/core/lazy.py +3 -3
- oscura/core/logging.py +6 -6
- oscura/core/logging_advanced.py +1 -1
- oscura/core/memoize.py +3 -3
- oscura/core/memory_check.py +1 -1
- oscura/core/memory_guard.py +1 -1
- oscura/core/memory_limits.py +1 -1
- oscura/core/memory_monitor.py +1 -1
- oscura/core/memory_progress.py +1 -1
- oscura/core/memory_warnings.py +1 -1
- oscura/core/progress.py +1 -1
- oscura/core/provenance.py +5 -5
- oscura/core/results.py +3 -3
- oscura/core/types.py +1 -1
- oscura/core/uncertainty.py +1 -1
- oscura/discovery/__init__.py +4 -4
- oscura/discovery/comparison.py +1 -1
- oscura/dsl/__init__.py +1 -1
- oscura/dsl/commands.py +22 -22
- oscura/dsl/interpreter.py +4 -4
- oscura/dsl/parser.py +4 -4
- oscura/dsl/repl.py +4 -4
- oscura/exceptions.py +3 -3
- oscura/export/__init__.py +2 -2
- oscura/export/wireshark/__init__.py +1 -1
- oscura/export/wireshark/generator.py +2 -2
- oscura/export/wireshark/templates/dissector.lua.j2 +1 -1
- oscura/export/wireshark/type_mapping.py +8 -8
- oscura/exporters/__init__.py +3 -3
- oscura/exporters/csv.py +1 -1
- oscura/exporters/html_export.py +5 -5
- oscura/exporters/json_export.py +9 -9
- oscura/exporters/markdown_export.py +3 -3
- oscura/exporters/npz_export.py +1 -1
- oscura/exporters/spice_export.py +1 -1
- oscura/extensibility/__init__.py +1 -1
- oscura/extensibility/docs.py +1 -1
- oscura/extensibility/extensions.py +7 -7
- oscura/extensibility/measurements.py +12 -12
- oscura/extensibility/plugins.py +12 -12
- oscura/extensibility/registry.py +12 -12
- oscura/extensibility/templates.py +16 -16
- oscura/extensibility/validation.py +3 -3
- oscura/filtering/__init__.py +1 -1
- oscura/filtering/base.py +1 -1
- oscura/filtering/convenience.py +1 -1
- oscura/filtering/design.py +1 -1
- oscura/filtering/introspection.py +1 -1
- oscura/guidance/__init__.py +1 -1
- oscura/guidance/recommender.py +1 -1
- oscura/guidance/wizard.py +1 -1
- oscura/inference/__init__.py +1 -1
- oscura/inference/adaptive_tuning.py +3 -3
- oscura/inference/logic.py +5 -5
- oscura/inference/protocol.py +5 -5
- oscura/inference/signal_intelligence.py +19 -19
- oscura/inference/spectral.py +6 -6
- oscura/integrations/__init__.py +1 -1
- oscura/integrations/llm.py +6 -6
- oscura/jupyter/__init__.py +3 -3
- oscura/jupyter/display.py +1 -1
- oscura/jupyter/magic.py +31 -31
- oscura/loaders/__init__.py +10 -10
- oscura/loaders/mmap_loader.py +1 -1
- oscura/loaders/pcap.py +1 -1
- oscura/math/__init__.py +1 -1
- oscura/math/arithmetic.py +1 -1
- oscura/math/interpolation.py +1 -1
- oscura/onboarding/__init__.py +1 -1
- oscura/onboarding/help.py +18 -18
- oscura/onboarding/tutorials.py +29 -29
- oscura/onboarding/wizard.py +22 -22
- oscura/pipeline/composition.py +15 -15
- oscura/pipeline/pipeline.py +10 -10
- oscura/plugins/__init__.py +2 -2
- oscura/plugins/base.py +5 -5
- oscura/plugins/discovery.py +6 -6
- oscura/plugins/registry.py +6 -6
- oscura/plugins/versioning.py +2 -2
- oscura/quality/__init__.py +1 -1
- oscura/quality/scoring.py +1 -1
- oscura/quality/warnings.py +1 -1
- oscura/reporting/__init__.py +1 -1
- oscura/reporting/advanced.py +1 -1
- oscura/reporting/analyze.py +1 -1
- oscura/reporting/auto_report.py +2 -2
- oscura/reporting/batch.py +3 -3
- oscura/reporting/chart_selection.py +1 -1
- oscura/reporting/comparison.py +1 -1
- oscura/reporting/core.py +4 -4
- oscura/reporting/export.py +1 -1
- oscura/reporting/formatting.py +1 -1
- oscura/reporting/html.py +3 -3
- oscura/reporting/multichannel.py +1 -1
- oscura/reporting/output.py +1 -1
- oscura/reporting/pdf.py +2 -2
- oscura/reporting/pptx_export.py +1 -1
- oscura/reporting/sections.py +1 -1
- oscura/reporting/standards.py +2 -2
- oscura/reporting/summary_generator.py +1 -1
- oscura/reporting/tables.py +1 -1
- oscura/reporting/template_system.py +1 -1
- oscura/reporting/templates/index.html +2 -2
- oscura/schemas/__init__.py +2 -2
- oscura/schemas/bus_configuration.json +1 -1
- oscura/schemas/device_mapping.json +1 -1
- oscura/schemas/packet_format.json +1 -1
- oscura/schemas/protocol_definition.json +1 -1
- oscura/search/__init__.py +1 -1
- oscura/session/__init__.py +4 -4
- oscura/session/history.py +7 -7
- oscura/session/session.py +2 -2
- oscura/streaming/chunked.py +7 -7
- oscura/testing/__init__.py +1 -1
- oscura/triggering/__init__.py +1 -1
- oscura/triggering/base.py +1 -1
- oscura/triggering/edge.py +1 -1
- oscura/triggering/pattern.py +1 -1
- oscura/triggering/pulse.py +1 -1
- oscura/triggering/window.py +1 -1
- oscura/ui/__init__.py +1 -1
- oscura/ui/formatters.py +1 -1
- oscura/ui/progressive_display.py +1 -1
- oscura/utils/__init__.py +1 -1
- oscura/utils/memory.py +3 -3
- oscura/utils/memory_extensions.py +1 -1
- oscura/visualization/__init__.py +1 -1
- oscura/visualization/accessibility.py +1 -1
- oscura/visualization/keyboard.py +1 -1
- oscura/visualization/palettes.py +1 -1
- oscura/visualization/spectral.py +9 -9
- oscura/visualization/waveform.py +4 -4
- oscura/workflows/__init__.py +5 -5
- oscura/workflows/compliance.py +5 -5
- oscura/workflows/digital.py +5 -5
- oscura/workflows/multi_trace.py +25 -25
- oscura/workflows/power.py +7 -7
- oscura/workflows/protocol.py +5 -5
- oscura/workflows/reverse_engineering.py +5 -5
- oscura/workflows/signal_integrity.py +6 -6
- {oscura-0.1.0.dist-info → oscura-0.1.1.dist-info}/METADATA +11 -11
- {oscura-0.1.0.dist-info → oscura-0.1.1.dist-info}/RECORD +212 -212
- {oscura-0.1.0.dist-info → oscura-0.1.1.dist-info}/WHEEL +0 -0
- {oscura-0.1.0.dist-info → oscura-0.1.1.dist-info}/entry_points.txt +0 -0
- {oscura-0.1.0.dist-info → oscura-0.1.1.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"""Plugin template generation for creating new
|
|
1
|
+
"""Plugin template generation for creating new Oscura plugins.
|
|
2
2
|
|
|
3
3
|
This module provides tools for generating plugin skeletons with all necessary
|
|
4
4
|
boilerplate code, tests, and documentation.
|
|
@@ -46,7 +46,7 @@ class PluginTemplate:
|
|
|
46
46
|
plugin_type: PluginType
|
|
47
47
|
output_dir: Path
|
|
48
48
|
author: str = "Plugin Author"
|
|
49
|
-
description: str = "Custom
|
|
49
|
+
description: str = "Custom Oscura plugin"
|
|
50
50
|
version: str = "0.1.0"
|
|
51
51
|
|
|
52
52
|
|
|
@@ -117,7 +117,7 @@ def generate_plugin_template(
|
|
|
117
117
|
|
|
118
118
|
# Generate default description if not provided
|
|
119
119
|
if description is None:
|
|
120
|
-
description = f"Custom {plugin_type} plugin for
|
|
120
|
+
description = f"Custom {plugin_type} plugin for Oscura"
|
|
121
121
|
|
|
122
122
|
# Create template configuration
|
|
123
123
|
template = PluginTemplate(
|
|
@@ -176,7 +176,7 @@ def _write_init_py(template: PluginTemplate) -> None:
|
|
|
176
176
|
content = textwrap.dedent(f'''\
|
|
177
177
|
"""{template.description}
|
|
178
178
|
|
|
179
|
-
This plugin integrates with
|
|
179
|
+
This plugin integrates with Oscura via entry points.
|
|
180
180
|
|
|
181
181
|
Plugin Metadata:
|
|
182
182
|
Name: {template.name}
|
|
@@ -188,7 +188,7 @@ def _write_init_py(template: PluginTemplate) -> None:
|
|
|
188
188
|
pip install -e .
|
|
189
189
|
|
|
190
190
|
Usage:
|
|
191
|
-
import oscura as
|
|
191
|
+
import oscura as osc
|
|
192
192
|
# Plugin auto-discovered via entry points
|
|
193
193
|
# See README.md for usage examples
|
|
194
194
|
|
|
@@ -328,10 +328,10 @@ def _write_readme(template: PluginTemplate) -> None:
|
|
|
328
328
|
|
|
329
329
|
## Usage
|
|
330
330
|
|
|
331
|
-
The plugin integrates automatically with
|
|
331
|
+
The plugin integrates automatically with Oscura via entry points:
|
|
332
332
|
|
|
333
333
|
```python
|
|
334
|
-
import oscura as
|
|
334
|
+
import oscura as osc
|
|
335
335
|
|
|
336
336
|
# Plugin is automatically discovered
|
|
337
337
|
# USER: Add usage examples specific to your plugin
|
|
@@ -350,7 +350,7 @@ def _write_readme(template: PluginTemplate) -> None:
|
|
|
350
350
|
|
|
351
351
|
## CLI Integration
|
|
352
352
|
|
|
353
|
-
After installation, the plugin is available in
|
|
353
|
+
After installation, the plugin is available in Oscura CLI:
|
|
354
354
|
|
|
355
355
|
```bash
|
|
356
356
|
# List installed plugins
|
|
@@ -383,7 +383,7 @@ def _write_readme(template: PluginTemplate) -> None:
|
|
|
383
383
|
|
|
384
384
|
## Plugin Type: {template.plugin_type}
|
|
385
385
|
|
|
386
|
-
This is a **{template.plugin_type}** plugin for
|
|
386
|
+
This is a **{template.plugin_type}** plugin for Oscura.
|
|
387
387
|
|
|
388
388
|
### Entry Point
|
|
389
389
|
|
|
@@ -391,7 +391,7 @@ def _write_readme(template: PluginTemplate) -> None:
|
|
|
391
391
|
|
|
392
392
|
## Requirements
|
|
393
393
|
|
|
394
|
-
-
|
|
394
|
+
- Oscura >= 0.1.0
|
|
395
395
|
- Python >= 3.12
|
|
396
396
|
|
|
397
397
|
## License
|
|
@@ -453,7 +453,7 @@ def _write_pyproject_toml(template: PluginTemplate) -> None:
|
|
|
453
453
|
"mypy>=1.13.0",
|
|
454
454
|
]
|
|
455
455
|
|
|
456
|
-
#
|
|
456
|
+
# Oscura plugin entry point
|
|
457
457
|
[project.entry-points."{entry_point_group}"]
|
|
458
458
|
{template.name} = "{template.name}:{class_name}"
|
|
459
459
|
|
|
@@ -528,7 +528,7 @@ def _generate_decoder_stub(template: PluginTemplate, class_name: str) -> str:
|
|
|
528
528
|
return textwrap.dedent(f'''\
|
|
529
529
|
"""{template.description}
|
|
530
530
|
|
|
531
|
-
This decoder implements protocol decoding for
|
|
531
|
+
This decoder implements protocol decoding for Oscura.
|
|
532
532
|
|
|
533
533
|
References:
|
|
534
534
|
PLUG-008: Plugin Template Generator
|
|
@@ -617,7 +617,7 @@ def _generate_analyzer_stub(template: PluginTemplate, class_name: str) -> str:
|
|
|
617
617
|
return textwrap.dedent(f'''\
|
|
618
618
|
"""{template.description}
|
|
619
619
|
|
|
620
|
-
This analyzer implements custom signal analysis for
|
|
620
|
+
This analyzer implements custom signal analysis for Oscura.
|
|
621
621
|
|
|
622
622
|
References:
|
|
623
623
|
PLUG-008: Plugin Template Generator
|
|
@@ -692,7 +692,7 @@ def _generate_loader_stub(template: PluginTemplate, class_name: str) -> str:
|
|
|
692
692
|
return textwrap.dedent(f'''\
|
|
693
693
|
"""{template.description}
|
|
694
694
|
|
|
695
|
-
This loader implements file format loading for
|
|
695
|
+
This loader implements file format loading for Oscura.
|
|
696
696
|
|
|
697
697
|
References:
|
|
698
698
|
PLUG-008: Plugin Template Generator
|
|
@@ -777,7 +777,7 @@ def _generate_exporter_stub(template: PluginTemplate, class_name: str) -> str:
|
|
|
777
777
|
return textwrap.dedent(f'''\
|
|
778
778
|
"""{template.description}
|
|
779
779
|
|
|
780
|
-
This exporter implements custom export format for
|
|
780
|
+
This exporter implements custom export format for Oscura.
|
|
781
781
|
|
|
782
782
|
References:
|
|
783
783
|
PLUG-008: Plugin Template Generator
|
|
@@ -866,7 +866,7 @@ def _generate_generic_stub(template: PluginTemplate, class_name: str) -> str:
|
|
|
866
866
|
return textwrap.dedent(f'''\
|
|
867
867
|
"""{template.description}
|
|
868
868
|
|
|
869
|
-
This is a generic plugin implementation for
|
|
869
|
+
This is a generic plugin implementation for Oscura.
|
|
870
870
|
|
|
871
871
|
References:
|
|
872
872
|
PLUG-008: Plugin Template Generator
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"""Extension validation system for
|
|
1
|
+
"""Extension validation system for Oscura plugins and custom decoders.
|
|
2
2
|
|
|
3
3
|
This module provides comprehensive validation of extensions including metadata
|
|
4
4
|
validation, interface compliance checking, dependency verification, and
|
|
@@ -515,7 +515,7 @@ def _validate_entry_points(extension_path: Path, result: ValidationResult) -> No
|
|
|
515
515
|
|
|
516
516
|
if not oscura_groups:
|
|
517
517
|
result.add_warning(
|
|
518
|
-
"No
|
|
518
|
+
"No Oscura entry points found",
|
|
519
519
|
location="[project.entry-points]",
|
|
520
520
|
fix_hint="Add entry point like: oscura.decoders = ...",
|
|
521
521
|
)
|
|
@@ -589,7 +589,7 @@ def _check_dependencies(extension_path: Path, result: ValidationResult) -> None:
|
|
|
589
589
|
oscura_deps = [d for d in dependencies if "oscura" in d.lower()]
|
|
590
590
|
if not oscura_deps:
|
|
591
591
|
result.add_warning(
|
|
592
|
-
"
|
|
592
|
+
"Oscura not listed in dependencies",
|
|
593
593
|
location="[project.dependencies]",
|
|
594
594
|
fix_hint='Add: "oscura>=0.1.0"',
|
|
595
595
|
)
|
oscura/filtering/__init__.py
CHANGED
oscura/filtering/base.py
CHANGED
oscura/filtering/convenience.py
CHANGED
oscura/filtering/design.py
CHANGED
oscura/guidance/__init__.py
CHANGED
oscura/guidance/recommender.py
CHANGED
oscura/guidance/wizard.py
CHANGED
oscura/inference/__init__.py
CHANGED
|
@@ -5,9 +5,9 @@ reducing the need for manual parameter specification.
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
Example:
|
|
8
|
-
>>> import oscura as
|
|
9
|
-
>>> trace =
|
|
10
|
-
>>> tuner =
|
|
8
|
+
>>> import oscura as osc
|
|
9
|
+
>>> trace = osc.load('signal.wfm')
|
|
10
|
+
>>> tuner = osc.AdaptiveParameterTuner(trace.data, trace.metadata.sample_rate)
|
|
11
11
|
>>> params = tuner.get_spectral_params()
|
|
12
12
|
>>> print(f"NFFT: {params.get('nfft')}")
|
|
13
13
|
>>> print(f"Window: {params.get('window')}")
|
oscura/inference/logic.py
CHANGED
|
@@ -5,9 +5,9 @@ detect the logic family (TTL, CMOS, LVTTL, LVCMOS, etc.).
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
Example:
|
|
8
|
-
>>> import oscura as
|
|
9
|
-
>>> trace =
|
|
10
|
-
>>> family =
|
|
8
|
+
>>> import oscura as osc
|
|
9
|
+
>>> trace = osc.load('digital_signal.wfm')
|
|
10
|
+
>>> family = osc.detect_logic_family(trace)
|
|
11
11
|
>>> print(f"Detected: {family['primary']['name']}")
|
|
12
12
|
>>> print(f"Confidence: {family['primary']['confidence']:.1%}")
|
|
13
13
|
|
|
@@ -122,8 +122,8 @@ def detect_logic_family(
|
|
|
122
122
|
AnalysisError: If signal is not bimodal or levels are ambiguous.
|
|
123
123
|
|
|
124
124
|
Example:
|
|
125
|
-
>>> trace =
|
|
126
|
-
>>> result =
|
|
125
|
+
>>> trace = osc.load('cmos_signal.wfm')
|
|
126
|
+
>>> result = osc.detect_logic_family(trace, return_candidates=True)
|
|
127
127
|
>>> print(f"Primary: {result['primary']['name']}")
|
|
128
128
|
>>> print(f"Confidence: {result['primary']['confidence']:.1%}")
|
|
129
129
|
>>> for candidate in result['candidates']:
|
oscura/inference/protocol.py
CHANGED
|
@@ -5,9 +5,9 @@ automatically detect serial protocol types.
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
Example:
|
|
8
|
-
>>> import oscura as
|
|
9
|
-
>>> trace =
|
|
10
|
-
>>> result =
|
|
8
|
+
>>> import oscura as osc
|
|
9
|
+
>>> trace = osc.load('serial_data.wfm')
|
|
10
|
+
>>> result = osc.detect_protocol(trace)
|
|
11
11
|
>>> print(f"Protocol: {result['protocol']}")
|
|
12
12
|
>>> print(f"Confidence: {result['confidence']:.1%}")
|
|
13
13
|
|
|
@@ -67,8 +67,8 @@ def detect_protocol(
|
|
|
67
67
|
AnalysisError: If no protocol can be detected with sufficient confidence.
|
|
68
68
|
|
|
69
69
|
Example:
|
|
70
|
-
>>> trace =
|
|
71
|
-
>>> result =
|
|
70
|
+
>>> trace = osc.load('unknown_serial.wfm')
|
|
71
|
+
>>> result = osc.detect_protocol(trace, return_candidates=True)
|
|
72
72
|
>>> print(f"Detected: {result['protocol']}")
|
|
73
73
|
>>> print(f"Baud rate: {result['config'].get('baud_rate', 'N/A')}")
|
|
74
74
|
>>> for candidate in result['candidates']:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"""Signal classification and measurement intelligence for
|
|
1
|
+
"""Signal classification and measurement intelligence for Oscura.
|
|
2
2
|
|
|
3
3
|
This module provides intelligent signal type detection, quality assessment,
|
|
4
4
|
and measurement suitability checking to help users understand why they might
|
|
@@ -6,14 +6,14 @@ get NaN results and which measurements are appropriate for their signals.
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
Example:
|
|
9
|
-
>>> import oscura as
|
|
10
|
-
>>> trace =
|
|
11
|
-
>>> classification =
|
|
9
|
+
>>> import oscura as osc
|
|
10
|
+
>>> trace = osc.load('signal.wfm')
|
|
11
|
+
>>> classification = osc.classify_signal(trace)
|
|
12
12
|
>>> print(f"Signal type: {classification['type']}")
|
|
13
13
|
>>> print(f"Characteristics: {classification['characteristics']}")
|
|
14
|
-
>>> quality =
|
|
14
|
+
>>> quality = osc.assess_signal_quality(trace)
|
|
15
15
|
>>> print(f"SNR: {quality['snr']:.1f} dB")
|
|
16
|
-
>>> suggestions =
|
|
16
|
+
>>> suggestions = osc.suggest_measurements(trace)
|
|
17
17
|
>>> print(f"Recommended measurements: {suggestions}")
|
|
18
18
|
|
|
19
19
|
References:
|
|
@@ -71,8 +71,8 @@ def classify_signal(
|
|
|
71
71
|
- levels: For digital signals, dict with "low" and "high" levels
|
|
72
72
|
|
|
73
73
|
Example:
|
|
74
|
-
>>> trace =
|
|
75
|
-
>>> info =
|
|
74
|
+
>>> trace = osc.load('square_wave.wfm')
|
|
75
|
+
>>> info = osc.classify_signal(trace)
|
|
76
76
|
>>> print(f"Type: {info['signal_type']}")
|
|
77
77
|
Type: digital
|
|
78
78
|
>>> print(f"Characteristics: {info['characteristics']}")
|
|
@@ -289,8 +289,8 @@ def assess_signal_quality(
|
|
|
289
289
|
- crest_factor: Peak-to-RMS ratio
|
|
290
290
|
|
|
291
291
|
Example:
|
|
292
|
-
>>> trace =
|
|
293
|
-
>>> quality =
|
|
292
|
+
>>> trace = osc.load('noisy_sine.wfm')
|
|
293
|
+
>>> quality = osc.assess_signal_quality(trace)
|
|
294
294
|
>>> print(f"SNR: {quality['snr']:.1f} dB")
|
|
295
295
|
SNR: 42.3 dB
|
|
296
296
|
>>> if quality['warnings']:
|
|
@@ -487,8 +487,8 @@ def check_measurement_suitability(
|
|
|
487
487
|
- expected_result: "valid", "nan", or "unreliable"
|
|
488
488
|
|
|
489
489
|
Example:
|
|
490
|
-
>>> trace =
|
|
491
|
-
>>> check =
|
|
490
|
+
>>> trace = osc.load('dc_signal.wfm')
|
|
491
|
+
>>> check = osc.check_measurement_suitability(trace, "frequency")
|
|
492
492
|
>>> if not check['suitable']:
|
|
493
493
|
... print(f"Warning: {check['warnings']}")
|
|
494
494
|
Warning: ['Frequency measurement not suitable for DC signal']
|
|
@@ -661,8 +661,8 @@ def suggest_measurements(
|
|
|
661
661
|
- confidence: Confidence in recommendation (0.0-1.0)
|
|
662
662
|
|
|
663
663
|
Example:
|
|
664
|
-
>>> trace =
|
|
665
|
-
>>> suggestions =
|
|
664
|
+
>>> trace = osc.load('square_wave.wfm')
|
|
665
|
+
>>> suggestions = osc.suggest_measurements(trace)
|
|
666
666
|
>>> for s in suggestions[:3]:
|
|
667
667
|
... print(f"{s['name']}: {s['rationale']}")
|
|
668
668
|
frequency: Periodic digital signal detected
|
|
@@ -1268,11 +1268,11 @@ def recommend_analyses(
|
|
|
1268
1268
|
|
|
1269
1269
|
Example:
|
|
1270
1270
|
>>> import numpy as np
|
|
1271
|
-
>>> import oscura as
|
|
1271
|
+
>>> import oscura as osc
|
|
1272
1272
|
>>> # Generate test signal
|
|
1273
1273
|
>>> t = np.linspace(0, 1, 10000)
|
|
1274
1274
|
>>> signal = np.sin(2 * np.pi * 100 * t)
|
|
1275
|
-
>>> recommendations =
|
|
1275
|
+
>>> recommendations = osc.recommend_analyses(signal, sample_rate=10000)
|
|
1276
1276
|
>>> for rec in recommendations[:3]:
|
|
1277
1277
|
... print(f"{rec.domain.value}: {rec.reasoning}")
|
|
1278
1278
|
waveform: Basic waveform measurements are always applicable
|
|
@@ -1452,12 +1452,12 @@ def get_optimal_domain_order(
|
|
|
1452
1452
|
|
|
1453
1453
|
Example:
|
|
1454
1454
|
>>> import numpy as np
|
|
1455
|
-
>>> import oscura as
|
|
1455
|
+
>>> import oscura as osc
|
|
1456
1456
|
>>> # Generate test signal
|
|
1457
1457
|
>>> t = np.linspace(0, 1, 10000)
|
|
1458
1458
|
>>> signal = np.sin(2 * np.pi * 100 * t)
|
|
1459
|
-
>>> recommendations =
|
|
1460
|
-
>>> order =
|
|
1459
|
+
>>> recommendations = osc.recommend_analyses(signal, sample_rate=10000)
|
|
1460
|
+
>>> order = osc.get_optimal_domain_order(recommendations)
|
|
1461
1461
|
>>> print([d.value for d in order])
|
|
1462
1462
|
['waveform', 'statistics', 'spectral', 'patterns', 'entropy']
|
|
1463
1463
|
"""
|
oscura/inference/spectral.py
CHANGED
|
@@ -5,9 +5,9 @@ based on signal characteristics.
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
Example:
|
|
8
|
-
>>> import oscura as
|
|
9
|
-
>>> trace =
|
|
10
|
-
>>> config =
|
|
8
|
+
>>> import oscura as osc
|
|
9
|
+
>>> trace = osc.load('signal.wfm')
|
|
10
|
+
>>> config = osc.auto_spectral_config(trace)
|
|
11
11
|
>>> print(f"Method: {config['method']}")
|
|
12
12
|
>>> print(f"Window: {config['window']}")
|
|
13
13
|
|
|
@@ -60,13 +60,13 @@ def auto_spectral_config(
|
|
|
60
60
|
- rationale: Explanation of selection (if log_rationale=True)
|
|
61
61
|
|
|
62
62
|
Example:
|
|
63
|
-
>>> trace =
|
|
64
|
-
>>> config =
|
|
63
|
+
>>> trace = osc.load('noisy_signal.wfm')
|
|
64
|
+
>>> config = osc.auto_spectral_config(trace, dynamic_range_db=80)
|
|
65
65
|
>>> print(f"Method: {config['method']}")
|
|
66
66
|
>>> print(f"Window: {config['window']}")
|
|
67
67
|
>>> print(f"Rationale: {config['rationale']}")
|
|
68
68
|
>>> # Use configuration
|
|
69
|
-
>>> freq, psd =
|
|
69
|
+
>>> freq, psd = osc.psd(trace, **config)
|
|
70
70
|
|
|
71
71
|
References:
|
|
72
72
|
Welch, P. D. (1967): Use of FFT for estimation of power spectra
|
oscura/integrations/__init__.py
CHANGED
oscura/integrations/llm.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"""LLM Integration for
|
|
1
|
+
"""LLM Integration for Oscura.
|
|
2
2
|
|
|
3
3
|
Provides hooks for Large Language Model integration to enable natural language
|
|
4
4
|
analysis and assistance.
|
|
@@ -33,7 +33,7 @@ from enum import Enum
|
|
|
33
33
|
from threading import Lock
|
|
34
34
|
from typing import Any, Protocol
|
|
35
35
|
|
|
36
|
-
from oscura.core.exceptions import
|
|
36
|
+
from oscura.core.exceptions import OscuraError
|
|
37
37
|
|
|
38
38
|
# ==============================================================================
|
|
39
39
|
# Cost Constants (API-020: Cost Tracking)
|
|
@@ -339,7 +339,7 @@ class LLMResponse:
|
|
|
339
339
|
Attributes:
|
|
340
340
|
answer: Main text response
|
|
341
341
|
confidence: Confidence score (0-1) if available
|
|
342
|
-
suggested_commands: List of suggested
|
|
342
|
+
suggested_commands: List of suggested Oscura commands
|
|
343
343
|
metadata: Additional metadata from LLM
|
|
344
344
|
raw_response: Raw response data for debugging
|
|
345
345
|
estimated_cost: Estimated cost in USD for this request (API-020)
|
|
@@ -385,7 +385,7 @@ class LLMClient(Protocol):
|
|
|
385
385
|
...
|
|
386
386
|
|
|
387
387
|
|
|
388
|
-
class LLMError(
|
|
388
|
+
class LLMError(OscuraError):
|
|
389
389
|
"""LLM integration error."""
|
|
390
390
|
|
|
391
391
|
|
|
@@ -875,7 +875,7 @@ class OpenAIClient:
|
|
|
875
875
|
return "\n".join(summary_parts)
|
|
876
876
|
|
|
877
877
|
def _extract_commands(self, text: str) -> list[str]:
|
|
878
|
-
"""Extract suggested
|
|
878
|
+
"""Extract suggested Oscura commands from LLM response.
|
|
879
879
|
|
|
880
880
|
Args:
|
|
881
881
|
text: LLM response text
|
|
@@ -1225,7 +1225,7 @@ class AnthropicClient:
|
|
|
1225
1225
|
return "\n".join(summary_parts)
|
|
1226
1226
|
|
|
1227
1227
|
def _extract_commands(self, text: str) -> list[str]:
|
|
1228
|
-
"""Extract suggested
|
|
1228
|
+
"""Extract suggested Oscura commands from LLM response.
|
|
1229
1229
|
|
|
1230
1230
|
Args:
|
|
1231
1231
|
text: LLM response text
|
oscura/jupyter/__init__.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"""Jupyter and IPython integration for
|
|
1
|
+
"""Jupyter and IPython integration for Oscura.
|
|
2
2
|
|
|
3
3
|
This package provides IPython magic commands, rich display integration,
|
|
4
4
|
and Jupyter notebook-specific features.
|
|
@@ -17,14 +17,14 @@ from oscura.jupyter.display import (
|
|
|
17
17
|
display_trace,
|
|
18
18
|
)
|
|
19
19
|
from oscura.jupyter.magic import (
|
|
20
|
-
|
|
20
|
+
OscuraMagics,
|
|
21
21
|
load_ipython_extension,
|
|
22
22
|
)
|
|
23
23
|
|
|
24
24
|
__all__ = [
|
|
25
25
|
"MeasurementDisplay",
|
|
26
|
+
"OscuraMagics",
|
|
26
27
|
"TraceDisplay",
|
|
27
|
-
"TracekitMagics",
|
|
28
28
|
"display_measurements",
|
|
29
29
|
"display_spectrum",
|
|
30
30
|
"display_trace",
|
oscura/jupyter/display.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""Rich display integration for Jupyter notebooks.
|
|
2
2
|
|
|
3
|
-
This module provides rich HTML display for
|
|
3
|
+
This module provides rich HTML display for Oscura objects including
|
|
4
4
|
traces, measurements, and spectral data.
|
|
5
5
|
|
|
6
6
|
- HTML tables for measurements
|