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.
Files changed (212) hide show
  1. oscura/__init__.py +14 -14
  2. oscura/__main__.py +9 -9
  3. oscura/analyzers/__init__.py +1 -1
  4. oscura/analyzers/packet/daq.py +1 -1
  5. oscura/analyzers/patterns/__init__.py +2 -2
  6. oscura/analyzers/patterns/clustering.py +1 -1
  7. oscura/analyzers/patterns/discovery.py +1 -1
  8. oscura/analyzers/patterns/periodic.py +1 -1
  9. oscura/analyzers/patterns/sequences.py +1 -1
  10. oscura/analyzers/power/__init__.py +1 -1
  11. oscura/analyzers/power/ac_power.py +1 -1
  12. oscura/analyzers/power/basic.py +1 -1
  13. oscura/analyzers/power/conduction.py +1 -1
  14. oscura/analyzers/power/efficiency.py +1 -1
  15. oscura/analyzers/power/ripple.py +1 -1
  16. oscura/analyzers/power/soa.py +1 -1
  17. oscura/analyzers/power/switching.py +1 -1
  18. oscura/api/__init__.py +1 -1
  19. oscura/automotive/__init__.py +1 -1
  20. oscura/automotive/can/checksum.py +2 -2
  21. oscura/automotive/can/session.py +1 -1
  22. oscura/automotive/can/state_machine.py +1 -1
  23. oscura/automotive/dbc/generator.py +1 -1
  24. oscura/automotive/dbc/parser.py +1 -1
  25. oscura/automotive/loaders/pcap.py +1 -1
  26. oscura/batch/__init__.py +1 -1
  27. oscura/batch/aggregate.py +2 -2
  28. oscura/batch/analyze.py +3 -3
  29. oscura/builders/__init__.py +7 -7
  30. oscura/builders/signal_builder.py +4 -4
  31. oscura/cli/__init__.py +1 -1
  32. oscura/cli/batch.py +1 -1
  33. oscura/cli/characterize.py +2 -2
  34. oscura/cli/compare.py +4 -4
  35. oscura/cli/decode.py +1 -1
  36. oscura/cli/main.py +8 -8
  37. oscura/cli/shell.py +19 -19
  38. oscura/comparison/__init__.py +1 -1
  39. oscura/comparison/compare.py +1 -1
  40. oscura/comparison/golden.py +1 -1
  41. oscura/comparison/limits.py +1 -1
  42. oscura/comparison/mask.py +1 -1
  43. oscura/comparison/trace_diff.py +1 -1
  44. oscura/compliance/__init__.py +2 -2
  45. oscura/compliance/reporting.py +2 -2
  46. oscura/component/__init__.py +1 -1
  47. oscura/component/impedance.py +1 -1
  48. oscura/component/reactive.py +1 -1
  49. oscura/component/transmission_line.py +1 -1
  50. oscura/config/__init__.py +1 -1
  51. oscura/config/loader.py +1 -1
  52. oscura/config/memory.py +3 -3
  53. oscura/config/migration.py +1 -1
  54. oscura/config/preferences.py +1 -1
  55. oscura/config/schema.py +3 -3
  56. oscura/config/settings.py +1 -1
  57. oscura/convenience.py +13 -13
  58. oscura/core/__init__.py +6 -6
  59. oscura/core/cache.py +10 -10
  60. oscura/core/cancellation.py +1 -1
  61. oscura/core/confidence.py +1 -1
  62. oscura/core/config.py +1 -1
  63. oscura/core/correlation.py +1 -1
  64. oscura/core/debug.py +4 -4
  65. oscura/core/edge_cases.py +1 -1
  66. oscura/core/exceptions.py +14 -14
  67. oscura/core/gpu_backend.py +5 -5
  68. oscura/core/lazy.py +3 -3
  69. oscura/core/logging.py +6 -6
  70. oscura/core/logging_advanced.py +1 -1
  71. oscura/core/memoize.py +3 -3
  72. oscura/core/memory_check.py +1 -1
  73. oscura/core/memory_guard.py +1 -1
  74. oscura/core/memory_limits.py +1 -1
  75. oscura/core/memory_monitor.py +1 -1
  76. oscura/core/memory_progress.py +1 -1
  77. oscura/core/memory_warnings.py +1 -1
  78. oscura/core/progress.py +1 -1
  79. oscura/core/provenance.py +5 -5
  80. oscura/core/results.py +3 -3
  81. oscura/core/types.py +1 -1
  82. oscura/core/uncertainty.py +1 -1
  83. oscura/discovery/__init__.py +4 -4
  84. oscura/discovery/comparison.py +1 -1
  85. oscura/dsl/__init__.py +1 -1
  86. oscura/dsl/commands.py +22 -22
  87. oscura/dsl/interpreter.py +4 -4
  88. oscura/dsl/parser.py +4 -4
  89. oscura/dsl/repl.py +4 -4
  90. oscura/exceptions.py +3 -3
  91. oscura/export/__init__.py +2 -2
  92. oscura/export/wireshark/__init__.py +1 -1
  93. oscura/export/wireshark/generator.py +2 -2
  94. oscura/export/wireshark/templates/dissector.lua.j2 +1 -1
  95. oscura/export/wireshark/type_mapping.py +8 -8
  96. oscura/exporters/__init__.py +3 -3
  97. oscura/exporters/csv.py +1 -1
  98. oscura/exporters/html_export.py +5 -5
  99. oscura/exporters/json_export.py +9 -9
  100. oscura/exporters/markdown_export.py +3 -3
  101. oscura/exporters/npz_export.py +1 -1
  102. oscura/exporters/spice_export.py +1 -1
  103. oscura/extensibility/__init__.py +1 -1
  104. oscura/extensibility/docs.py +1 -1
  105. oscura/extensibility/extensions.py +7 -7
  106. oscura/extensibility/measurements.py +12 -12
  107. oscura/extensibility/plugins.py +12 -12
  108. oscura/extensibility/registry.py +12 -12
  109. oscura/extensibility/templates.py +16 -16
  110. oscura/extensibility/validation.py +3 -3
  111. oscura/filtering/__init__.py +1 -1
  112. oscura/filtering/base.py +1 -1
  113. oscura/filtering/convenience.py +1 -1
  114. oscura/filtering/design.py +1 -1
  115. oscura/filtering/introspection.py +1 -1
  116. oscura/guidance/__init__.py +1 -1
  117. oscura/guidance/recommender.py +1 -1
  118. oscura/guidance/wizard.py +1 -1
  119. oscura/inference/__init__.py +1 -1
  120. oscura/inference/adaptive_tuning.py +3 -3
  121. oscura/inference/logic.py +5 -5
  122. oscura/inference/protocol.py +5 -5
  123. oscura/inference/signal_intelligence.py +19 -19
  124. oscura/inference/spectral.py +6 -6
  125. oscura/integrations/__init__.py +1 -1
  126. oscura/integrations/llm.py +6 -6
  127. oscura/jupyter/__init__.py +3 -3
  128. oscura/jupyter/display.py +1 -1
  129. oscura/jupyter/magic.py +31 -31
  130. oscura/loaders/__init__.py +10 -10
  131. oscura/loaders/mmap_loader.py +1 -1
  132. oscura/loaders/pcap.py +1 -1
  133. oscura/math/__init__.py +1 -1
  134. oscura/math/arithmetic.py +1 -1
  135. oscura/math/interpolation.py +1 -1
  136. oscura/onboarding/__init__.py +1 -1
  137. oscura/onboarding/help.py +18 -18
  138. oscura/onboarding/tutorials.py +29 -29
  139. oscura/onboarding/wizard.py +22 -22
  140. oscura/pipeline/composition.py +15 -15
  141. oscura/pipeline/pipeline.py +10 -10
  142. oscura/plugins/__init__.py +2 -2
  143. oscura/plugins/base.py +5 -5
  144. oscura/plugins/discovery.py +6 -6
  145. oscura/plugins/registry.py +6 -6
  146. oscura/plugins/versioning.py +2 -2
  147. oscura/quality/__init__.py +1 -1
  148. oscura/quality/scoring.py +1 -1
  149. oscura/quality/warnings.py +1 -1
  150. oscura/reporting/__init__.py +1 -1
  151. oscura/reporting/advanced.py +1 -1
  152. oscura/reporting/analyze.py +1 -1
  153. oscura/reporting/auto_report.py +2 -2
  154. oscura/reporting/batch.py +3 -3
  155. oscura/reporting/chart_selection.py +1 -1
  156. oscura/reporting/comparison.py +1 -1
  157. oscura/reporting/core.py +4 -4
  158. oscura/reporting/export.py +1 -1
  159. oscura/reporting/formatting.py +1 -1
  160. oscura/reporting/html.py +3 -3
  161. oscura/reporting/multichannel.py +1 -1
  162. oscura/reporting/output.py +1 -1
  163. oscura/reporting/pdf.py +2 -2
  164. oscura/reporting/pptx_export.py +1 -1
  165. oscura/reporting/sections.py +1 -1
  166. oscura/reporting/standards.py +2 -2
  167. oscura/reporting/summary_generator.py +1 -1
  168. oscura/reporting/tables.py +1 -1
  169. oscura/reporting/template_system.py +1 -1
  170. oscura/reporting/templates/index.html +2 -2
  171. oscura/schemas/__init__.py +2 -2
  172. oscura/schemas/bus_configuration.json +1 -1
  173. oscura/schemas/device_mapping.json +1 -1
  174. oscura/schemas/packet_format.json +1 -1
  175. oscura/schemas/protocol_definition.json +1 -1
  176. oscura/search/__init__.py +1 -1
  177. oscura/session/__init__.py +4 -4
  178. oscura/session/history.py +7 -7
  179. oscura/session/session.py +2 -2
  180. oscura/streaming/chunked.py +7 -7
  181. oscura/testing/__init__.py +1 -1
  182. oscura/triggering/__init__.py +1 -1
  183. oscura/triggering/base.py +1 -1
  184. oscura/triggering/edge.py +1 -1
  185. oscura/triggering/pattern.py +1 -1
  186. oscura/triggering/pulse.py +1 -1
  187. oscura/triggering/window.py +1 -1
  188. oscura/ui/__init__.py +1 -1
  189. oscura/ui/formatters.py +1 -1
  190. oscura/ui/progressive_display.py +1 -1
  191. oscura/utils/__init__.py +1 -1
  192. oscura/utils/memory.py +3 -3
  193. oscura/utils/memory_extensions.py +1 -1
  194. oscura/visualization/__init__.py +1 -1
  195. oscura/visualization/accessibility.py +1 -1
  196. oscura/visualization/keyboard.py +1 -1
  197. oscura/visualization/palettes.py +1 -1
  198. oscura/visualization/spectral.py +9 -9
  199. oscura/visualization/waveform.py +4 -4
  200. oscura/workflows/__init__.py +5 -5
  201. oscura/workflows/compliance.py +5 -5
  202. oscura/workflows/digital.py +5 -5
  203. oscura/workflows/multi_trace.py +25 -25
  204. oscura/workflows/power.py +7 -7
  205. oscura/workflows/protocol.py +5 -5
  206. oscura/workflows/reverse_engineering.py +5 -5
  207. oscura/workflows/signal_integrity.py +6 -6
  208. {oscura-0.1.0.dist-info → oscura-0.1.1.dist-info}/METADATA +11 -11
  209. {oscura-0.1.0.dist-info → oscura-0.1.1.dist-info}/RECORD +212 -212
  210. {oscura-0.1.0.dist-info → oscura-0.1.1.dist-info}/WHEEL +0 -0
  211. {oscura-0.1.0.dist-info → oscura-0.1.1.dist-info}/entry_points.txt +0 -0
  212. {oscura-0.1.0.dist-info → oscura-0.1.1.dist-info}/licenses/LICENSE +0 -0
oscura/export/__init__.py CHANGED
@@ -1,6 +1,6 @@
1
- """Export module for TraceKit protocol definitions.
1
+ """Export module for Oscura protocol definitions.
2
2
 
3
- This module provides functionality to export TraceKit protocol definitions
3
+ This module provides functionality to export Oscura protocol definitions
4
4
  to various formats for integration with other tools and workflows.
5
5
 
6
6
  Supported export formats:
@@ -1,6 +1,6 @@
1
1
  """Wireshark dissector export module.
2
2
 
3
- This module provides functionality to export TraceKit protocol definitions
3
+ This module provides functionality to export Oscura protocol definitions
4
4
  as Wireshark Lua dissectors for integration with Wireshark's protocol
5
5
  analysis tools.
6
6
 
@@ -1,6 +1,6 @@
1
1
  """Wireshark Lua dissector generator.
2
2
 
3
- This module generates Wireshark Lua dissectors from TraceKit protocol definitions.
3
+ This module generates Wireshark Lua dissectors from Oscura protocol definitions.
4
4
  The generated dissectors can be loaded into Wireshark for interactive protocol analysis.
5
5
 
6
6
  Features:
@@ -29,7 +29,7 @@ from .validator import validate_lua_syntax
29
29
  class WiresharkDissectorGenerator:
30
30
  """Generate Wireshark Lua dissectors from protocol definitions.
31
31
 
32
- This class converts TraceKit protocol definitions into Wireshark Lua
32
+ This class converts Oscura protocol definitions into Wireshark Lua
33
33
  dissectors that can be loaded into Wireshark for protocol analysis.
34
34
 
35
35
  Features:
@@ -1,5 +1,5 @@
1
1
  -- {{ protocol.name }}.lua
2
- -- Generated by TraceKit on {{ timestamp }}
2
+ -- Generated by Oscura on {{ timestamp }}
3
3
  --
4
4
  -- Protocol: {{ protocol.description }}
5
5
  -- Version: {{ protocol.version }}
@@ -1,6 +1,6 @@
1
- """Type mapping between TraceKit field types and Wireshark ProtoField types.
1
+ """Type mapping between Oscura field types and Wireshark ProtoField types.
2
2
 
3
- This module provides mappings from TraceKit protocol field types to their
3
+ This module provides mappings from Oscura protocol field types to their
4
4
  corresponding Wireshark Lua ProtoField types and display bases.
5
5
 
6
6
  References:
@@ -9,7 +9,7 @@ References:
9
9
 
10
10
  from typing import Literal
11
11
 
12
- # Map TraceKit field types to Wireshark ProtoField types
12
+ # Map Oscura field types to Wireshark ProtoField types
13
13
  FIELD_TYPE_MAPPING: dict[str, str] = {
14
14
  "uint8": "ProtoField.uint8",
15
15
  "uint16": "ProtoField.uint16",
@@ -54,10 +54,10 @@ DEFAULT_BASE: dict[str, str] = {
54
54
 
55
55
 
56
56
  def get_protofield_type(field_type: str, display_base: str | None = None) -> tuple[str, str]:
57
- """Map TraceKit field type to Wireshark ProtoField and display base.
57
+ """Map Oscura field type to Wireshark ProtoField and display base.
58
58
 
59
59
  Args:
60
- field_type: TraceKit field type (uint8, uint16, string, etc.)
60
+ field_type: Oscura field type (uint8, uint16, string, etc.)
61
61
  display_base: Optional display base (dec, hex, oct, bin, none)
62
62
 
63
63
  Returns:
@@ -88,7 +88,7 @@ def get_field_size(field_type: str) -> int | None:
88
88
  """Get the fixed size in bytes for a field type.
89
89
 
90
90
  Args:
91
- field_type: TraceKit field type
91
+ field_type: Oscura field type
92
92
 
93
93
  Returns:
94
94
  Field size in bytes, or None for variable-length types
@@ -115,7 +115,7 @@ def is_variable_length(field_type: str) -> bool:
115
115
  """Check if a field type is variable length.
116
116
 
117
117
  Args:
118
- field_type: TraceKit field type
118
+ field_type: Oscura field type
119
119
 
120
120
  Returns:
121
121
  True if field is variable length
@@ -127,7 +127,7 @@ def get_lua_reader_function(field_type: str, endian: Literal["big", "little"] =
127
127
  """Get the Lua buffer reader function for a field type.
128
128
 
129
129
  Args:
130
- field_type: TraceKit field type
130
+ field_type: Oscura field type
131
131
  endian: Byte order (big or little endian)
132
132
 
133
133
  Returns:
@@ -1,4 +1,4 @@
1
- """Data export module for TraceKit.
1
+ """Data export module for Oscura.
2
2
 
3
3
  Provides export functionality to various file formats including CSV, HDF5,
4
4
  JSON, MATLAB, Markdown, HTML, NumPy NPZ, and SPICE PWL.
@@ -32,7 +32,7 @@ from oscura.exporters.html_export import (
32
32
  generate_html_report,
33
33
  )
34
34
  from oscura.exporters.json_export import (
35
- TraceKitJSONEncoder,
35
+ OscuraJSONEncoder,
36
36
  export_json,
37
37
  export_measurements,
38
38
  export_protocol_decode,
@@ -57,7 +57,7 @@ from oscura.exporters.spice_export import (
57
57
  )
58
58
 
59
59
  __all__ = [
60
- "TraceKitJSONEncoder",
60
+ "OscuraJSONEncoder",
61
61
  "append_trace",
62
62
  # CSV export (EXP-001)
63
63
  "export_csv",
oscura/exporters/csv.py CHANGED
@@ -107,7 +107,7 @@ def _export_trace(
107
107
  if header:
108
108
  # Metadata comments
109
109
  meta = trace.metadata
110
- f.write("# TraceKit CSV Export\n")
110
+ f.write("# Oscura CSV Export\n")
111
111
  f.write(f"# Sample Rate: {meta.sample_rate} Hz\n")
112
112
  f.write(f"# Time Base: {meta.time_base} s\n")
113
113
  f.write(f"# Samples: {len(trace.data)}\n")
@@ -1,4 +1,4 @@
1
- """HTML report export for TraceKit.
1
+ """HTML report export for Oscura.
2
2
 
3
3
  This module provides interactive HTML report generation with embedded Plotly charts,
4
4
  measurement tables, and custom styling/theming.
@@ -23,7 +23,7 @@ HTML_TEMPLATE = """<!DOCTYPE html>
23
23
  <head>
24
24
  <meta charset="UTF-8">
25
25
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
26
- <meta name="generator" content="TraceKit Export">
26
+ <meta name="generator" content="Oscura Export">
27
27
  <title>{title}</title>
28
28
  {plotly_script}
29
29
  <style>
@@ -235,7 +235,7 @@ HTML_TEMPLATE = """<!DOCTYPE html>
235
235
  {conclusions_html}
236
236
 
237
237
  <footer>
238
- Generated by TraceKit &middot; {timestamp}
238
+ Generated by Oscura &middot; {timestamp}
239
239
  </footer>
240
240
  </div>
241
241
  </body>
@@ -266,7 +266,7 @@ def export_html(
266
266
  data: dict[str, Any],
267
267
  path: str | Path,
268
268
  *,
269
- title: str = "TraceKit Analysis Report",
269
+ title: str = "Oscura Analysis Report",
270
270
  author: str | None = None,
271
271
  include_plots: bool = True,
272
272
  self_contained: bool = True,
@@ -313,7 +313,7 @@ def export_html(
313
313
  def generate_html_report(
314
314
  data: dict[str, Any],
315
315
  *,
316
- title: str = "TraceKit Analysis Report",
316
+ title: str = "Oscura Analysis Report",
317
317
  author: str | None = None,
318
318
  include_plots: bool = True,
319
319
  self_contained: bool = True,
@@ -25,8 +25,8 @@ import numpy as np
25
25
  from oscura.core.types import DigitalTrace, TraceMetadata, WaveformTrace
26
26
 
27
27
 
28
- class TraceKitJSONEncoder(json.JSONEncoder):
29
- """JSON encoder with numpy, datetime, and TraceKit object support."""
28
+ class OscuraJSONEncoder(json.JSONEncoder):
29
+ """JSON encoder with numpy, datetime, and Oscura object support."""
30
30
 
31
31
  def default(self, obj: Any) -> Any:
32
32
  if isinstance(obj, WaveformTrace):
@@ -141,9 +141,9 @@ def export_json(
141
141
 
142
142
  # Serialize to JSON string
143
143
  if pretty:
144
- json_str = json.dumps(output, cls=TraceKitJSONEncoder, indent=2)
144
+ json_str = json.dumps(output, cls=OscuraJSONEncoder, indent=2)
145
145
  else:
146
- json_str = json.dumps(output, cls=TraceKitJSONEncoder)
146
+ json_str = json.dumps(output, cls=OscuraJSONEncoder)
147
147
 
148
148
  # Write to file (with optional compression)
149
149
  if compress:
@@ -207,9 +207,9 @@ def export_measurements(
207
207
 
208
208
  with open(path, "w") as f:
209
209
  if pretty:
210
- json.dump(output, f, cls=TraceKitJSONEncoder, indent=2)
210
+ json.dump(output, f, cls=OscuraJSONEncoder, indent=2)
211
211
  else:
212
- json.dump(output, f, cls=TraceKitJSONEncoder)
212
+ json.dump(output, f, cls=OscuraJSONEncoder)
213
213
 
214
214
 
215
215
  def export_protocol_decode(
@@ -258,9 +258,9 @@ def export_protocol_decode(
258
258
 
259
259
  with open(path, "w") as f:
260
260
  if pretty:
261
- json.dump(output, f, cls=TraceKitJSONEncoder, indent=2)
261
+ json.dump(output, f, cls=OscuraJSONEncoder, indent=2)
262
262
  else:
263
- json.dump(output, f, cls=TraceKitJSONEncoder)
263
+ json.dump(output, f, cls=OscuraJSONEncoder)
264
264
 
265
265
 
266
266
  def load_json(path: str | Path) -> dict[str, Any]:
@@ -283,7 +283,7 @@ def load_json(path: str | Path) -> dict[str, Any]:
283
283
 
284
284
 
285
285
  __all__ = [
286
- "TraceKitJSONEncoder",
286
+ "OscuraJSONEncoder",
287
287
  "export_json",
288
288
  "export_measurements",
289
289
  "export_protocol_decode",
@@ -1,4 +1,4 @@
1
- """Markdown report export for TraceKit.
1
+ """Markdown report export for Oscura.
2
2
 
3
3
  This module provides Markdown report generation with measurement tables,
4
4
  plot references, and configurable sections.
@@ -22,7 +22,7 @@ def export_markdown(
22
22
  data: dict[str, Any],
23
23
  path: str | Path,
24
24
  *,
25
- title: str = "TraceKit Analysis Report",
25
+ title: str = "Oscura Analysis Report",
26
26
  author: str | None = None,
27
27
  include_plots: bool = True,
28
28
  embed_images: bool = True,
@@ -295,7 +295,7 @@ def _generate_plots_section(
295
295
  def generate_markdown_report(
296
296
  data: dict[str, Any],
297
297
  *,
298
- title: str = "TraceKit Analysis Report",
298
+ title: str = "Oscura Analysis Report",
299
299
  author: str | None = None,
300
300
  include_plots: bool = True,
301
301
  embed_images: bool = True,
@@ -1,4 +1,4 @@
1
- """NumPy NPZ export functionality for TraceKit.
1
+ """NumPy NPZ export functionality for Oscura.
2
2
 
3
3
  This module provides export to NumPy's compressed archive format for
4
4
  efficient storage and fast loading of trace data.
@@ -1,4 +1,4 @@
1
- """SPICE PWL export functionality for TraceKit.
1
+ """SPICE PWL export functionality for Oscura.
2
2
 
3
3
  This module provides export to SPICE Piece-Wise Linear (PWL) format for
4
4
  use in circuit simulation tools like LTspice, ngspice, Cadence, etc.
@@ -1,7 +1,7 @@
1
1
  """Extensibility framework for plugins and custom algorithms.
2
2
 
3
3
  This package provides registries, plugin management, and custom measurement
4
- frameworks for extending TraceKit functionality.
4
+ frameworks for extending Oscura functionality.
5
5
  """
6
6
 
7
7
  from .docs import (
@@ -1,6 +1,6 @@
1
1
  """Extension documentation auto-generation system.
2
2
 
3
- This module provides automatic documentation generation for TraceKit extensions
3
+ This module provides automatic documentation generation for Oscura extensions
4
4
  including API reference, usage examples, and metadata extraction from docstrings.
5
5
 
6
6
 
@@ -1,7 +1,7 @@
1
1
  """Extension point registry and management system.
2
2
 
3
3
  This module implements a central registry for extension points that allows
4
- plugins and custom code to extend TraceKit functionality at well-defined
4
+ plugins and custom code to extend Oscura functionality at well-defined
5
5
  integration points.
6
6
  """
7
7
 
@@ -170,7 +170,7 @@ class HookContext:
170
170
  abort_reason: Reason for abort
171
171
 
172
172
  Example:
173
- >>> @tk.hooks.register("pre_decode")
173
+ >>> @osc.hooks.register("pre_decode")
174
174
  >>> def validate_waveform(context):
175
175
  ... if context.data.sample_rate < 1000:
176
176
  ... context.abort = True
@@ -210,19 +210,19 @@ class RegisteredHook:
210
210
 
211
211
 
212
212
  class ExtensionPointRegistry:
213
- """Central registry of all extension points in TraceKit.
213
+ """Central registry of all extension points in Oscura.
214
214
 
215
215
  Manages registration and lookup of extension points, algorithms,
216
216
  and hooks throughout the system.
217
217
 
218
218
  Example:
219
219
  >>> # List all extension points
220
- >>> extension_points = tk.extensions.list()
220
+ >>> extension_points = osc.extensions.list()
221
221
  >>> for ep in extension_points:
222
222
  ... print(f"{ep.name} v{ep.version}")
223
223
 
224
224
  >>> # Get specific extension point
225
- >>> decoder_ep = tk.extensions.get("protocol_decoder")
225
+ >>> decoder_ep = osc.extensions.get("protocol_decoder")
226
226
  >>> print(f"Required methods: {decoder_ep.required_methods}")
227
227
 
228
228
  References:
@@ -256,7 +256,7 @@ class ExtensionPointRegistry:
256
256
  def initialize(self) -> None:
257
257
  """Initialize built-in extension points.
258
258
 
259
- Registers the standard extension points that come with TraceKit.
259
+ Registers the standard extension points that come with Oscura.
260
260
  """
261
261
  if self._initialized: # type: ignore[has-type]
262
262
  return
@@ -810,7 +810,7 @@ class ExtensionPointRegistry:
810
810
  name: Optional hook name for identification
811
811
 
812
812
  Example:
813
- >>> @tk.hooks.register("pre_decode")
813
+ >>> @osc.hooks.register("pre_decode")
814
814
  >>> def validate_waveform(context):
815
815
  ... if context.data.sample_rate < 1000:
816
816
  ... raise ValueError("Sample rate too low")
@@ -35,22 +35,22 @@ class MeasurementDefinition:
35
35
  tags: Optional tags for categorization and search.
36
36
 
37
37
  Example:
38
- >>> import oscura as tk
38
+ >>> import oscura as osc
39
39
  >>> def calculate_crest_factor(trace, **kwargs):
40
40
  ... peak = abs(trace.data).max()
41
41
  ... rms = (trace.data ** 2).mean() ** 0.5
42
42
  ... return peak / rms
43
- >>> tk.register_measurement(
43
+ >>> osc.register_measurement(
44
44
  ... name='crest_factor',
45
45
  ... func=calculate_crest_factor,
46
46
  ... units='ratio',
47
47
  ... category='amplitude'
48
48
  ... )
49
- >>> cf = tk.measure(trace, 'crest_factor')
49
+ >>> cf = osc.measure(trace, 'crest_factor')
50
50
 
51
51
  Advanced Example:
52
52
  >>> # Define measurement with full metadata
53
- >>> slew_rate_defn = tk.MeasurementDefinition(
53
+ >>> slew_rate_defn = osc.MeasurementDefinition(
54
54
  ... name='max_slew_rate',
55
55
  ... func=lambda trace: abs(trace.derivative()).max(),
56
56
  ... units='V/s',
@@ -58,7 +58,7 @@ class MeasurementDefinition:
58
58
  ... description='Maximum slew rate in trace',
59
59
  ... tags=['edge', 'derivative', 'speed']
60
60
  ... )
61
- >>> tk.register_measurement(slew_rate_defn)
61
+ >>> osc.register_measurement(slew_rate_defn)
62
62
 
63
63
  References:
64
64
  API-008: Custom Measurement Framework
@@ -389,12 +389,12 @@ def register_measurement(
389
389
  definition: Pre-built MeasurementDefinition.
390
390
 
391
391
  Example:
392
- >>> import oscura as tk
392
+ >>> import oscura as osc
393
393
  >>> def calculate_crest_factor(trace, **kwargs):
394
394
  ... peak = abs(trace.data).max()
395
395
  ... rms = (trace.data ** 2).mean() ** 0.5
396
396
  ... return peak / rms
397
- >>> tk.register_measurement(
397
+ >>> osc.register_measurement(
398
398
  ... name='crest_factor',
399
399
  ... func=calculate_crest_factor,
400
400
  ... units='ratio',
@@ -427,8 +427,8 @@ def measure(trace: WaveformTrace, name: str, **kwargs: Any) -> float:
427
427
  Measured value.
428
428
 
429
429
  Example:
430
- >>> import oscura as tk
431
- >>> cf = tk.measure(trace, 'crest_factor')
430
+ >>> import oscura as osc
431
+ >>> cf = osc.measure(trace, 'crest_factor')
432
432
  >>> print(f"Crest factor: {cf:.2f}")
433
433
 
434
434
  References:
@@ -452,8 +452,8 @@ def list_measurements(
452
452
  List of measurement names.
453
453
 
454
454
  Example:
455
- >>> import oscura as tk
456
- >>> measurements = tk.list_measurements(category='amplitude')
455
+ >>> import oscura as osc
456
+ >>> measurements = osc.list_measurements(category='amplitude')
457
457
  >>> print(f"Amplitude measurements: {measurements}")
458
458
 
459
459
  References:
@@ -469,7 +469,7 @@ def get_measurement_registry() -> MeasurementRegistry:
469
469
  Global MeasurementRegistry instance.
470
470
 
471
471
  Example:
472
- >>> registry = tk.get_measurement_registry()
472
+ >>> registry = osc.get_measurement_registry()
473
473
  >>> metadata = registry.get_metadata('crest_factor')
474
474
  """
475
475
  return _registry
@@ -23,8 +23,8 @@ class PluginError(Exception):
23
23
 
24
24
  Example:
25
25
  >>> try:
26
- ... plugin = tk.load_plugin('oscura.decoders', 'flexray')
27
- ... except tk.PluginError as e:
26
+ ... plugin = osc.load_plugin('oscura.decoders', 'flexray')
27
+ ... except osc.PluginError as e:
28
28
  ... print(f"Plugin failed: {e}")
29
29
 
30
30
  References:
@@ -87,20 +87,20 @@ class PluginManager:
87
87
  - oscura.exporters: Export format handlers
88
88
 
89
89
  Example:
90
- >>> import oscura as tk
90
+ >>> import oscura as osc
91
91
  >>> # Plugins auto-discovered from installed packages
92
92
  >>> # Use plugin decoder
93
- >>> can_frames = tk.decode(trace, protocol='can', baudrate=500000)
93
+ >>> can_frames = osc.decode(trace, protocol='can', baudrate=500000)
94
94
  >>> # List available plugins
95
- >>> plugins = tk.list_plugins()
95
+ >>> plugins = osc.list_plugins()
96
96
  >>> print(f"Installed plugins: {plugins}")
97
97
 
98
98
  Advanced Example:
99
99
  >>> # Manually load plugin with error handling
100
100
  >>> try:
101
- ... plugin = tk.load_plugin('oscura.decoders', 'flexray')
101
+ ... plugin = osc.load_plugin('oscura.decoders', 'flexray')
102
102
  ... print(f"Plugin loaded: {plugin.name} v{plugin.version}")
103
- ... except tk.PluginError as e:
103
+ ... except osc.PluginError as e:
104
104
  ... print(f"Plugin failed to load: {e}")
105
105
 
106
106
  Plugin Package Example:
@@ -361,8 +361,8 @@ def load_plugin(group: str, name: str) -> PluginMetadata:
361
361
  PluginMetadata with loaded plugin.
362
362
 
363
363
  Example:
364
- >>> import oscura as tk
365
- >>> plugin = tk.load_plugin('oscura.decoders', 'flexray')
364
+ >>> import oscura as osc
365
+ >>> plugin = osc.load_plugin('oscura.decoders', 'flexray')
366
366
  >>> print(f"Loaded {plugin.name} v{plugin.version}")
367
367
 
368
368
  References:
@@ -381,8 +381,8 @@ def list_plugins(group: str | None = None) -> dict[str, list[str]]:
381
381
  Dictionary mapping group names to plugin names.
382
382
 
383
383
  Example:
384
- >>> import oscura as tk
385
- >>> plugins = tk.list_plugins()
384
+ >>> import oscura as osc
385
+ >>> plugins = osc.list_plugins()
386
386
  >>> print(f"Available decoders: {plugins['oscura.decoders']}")
387
387
 
388
388
  References:
@@ -398,7 +398,7 @@ def get_plugin_manager() -> PluginManager:
398
398
  Global PluginManager instance.
399
399
 
400
400
  Example:
401
- >>> manager = tk.get_plugin_manager()
401
+ >>> manager = osc.get_plugin_manager()
402
402
  >>> loaded = manager.list_loaded_plugins()
403
403
  """
404
404
  return _manager
@@ -1,7 +1,7 @@
1
1
  """Algorithm registry for custom algorithm injection.
2
2
 
3
3
  This module implements a registry pattern that allows users to register
4
- custom algorithms and implementations at extension points throughout TraceKit.
4
+ custom algorithms and implementations at extension points throughout Oscura.
5
5
  """
6
6
 
7
7
  from __future__ import annotations
@@ -18,13 +18,13 @@ class AlgorithmRegistry:
18
18
 
19
19
  Allows users to register custom algorithms for various categories
20
20
  (edge detection, peak finding, window functions, etc.) that can be
21
- used throughout TraceKit.
21
+ used throughout Oscura.
22
22
 
23
23
  The registry validates algorithm signatures on registration and provides
24
24
  lookup by category and name.
25
25
 
26
26
  Example:
27
- >>> import oscura as tk
27
+ >>> import oscura as osc
28
28
  >>> def my_edge_detector(data, threshold=0.5):
29
29
  ... '''Custom Schmitt trigger edge detector'''
30
30
  ... edges = []
@@ -36,9 +36,9 @@ class AlgorithmRegistry:
36
36
  ... state = new_state
37
37
  ... return edges
38
38
  >>> # Register in algorithm registry
39
- >>> tk.register_algorithm('my_schmitt', my_edge_detector, category='edge_detector')
39
+ >>> osc.register_algorithm('my_schmitt', my_edge_detector, category='edge_detector')
40
40
  >>> # Use custom algorithm
41
- >>> edges = tk.find_edges(trace, method='my_schmitt', threshold=0.7)
41
+ >>> edges = osc.find_edges(trace, method='my_schmitt', threshold=0.7)
42
42
 
43
43
  Advanced Example:
44
44
  >>> # Register custom window function
@@ -46,11 +46,11 @@ class AlgorithmRegistry:
46
46
  >>> def custom_window(n, alpha=0.5):
47
47
  ... x = np.linspace(0, 1, n)
48
48
  ... return 0.5 * (1 + np.cos(2 * np.pi * alpha * (x - 0.5)))
49
- >>> tk.register_algorithm('custom_tukey', custom_window, category='window_func')
49
+ >>> osc.register_algorithm('custom_tukey', custom_window, category='window_func')
50
50
  >>> # Use in FFT
51
- >>> result = tk.fft(trace, nfft=8192, window='custom_tukey', alpha=0.3)
51
+ >>> result = osc.fft(trace, nfft=8192, window='custom_tukey', alpha=0.3)
52
52
  >>> # List available algorithms
53
- >>> available = tk.get_algorithms('window_func')
53
+ >>> available = osc.get_algorithms('window_func')
54
54
 
55
55
  References:
56
56
  API-006: Algorithm Override Hooks
@@ -288,10 +288,10 @@ def register_algorithm(
288
288
  validate: Whether to validate signature. Default True.
289
289
 
290
290
  Example:
291
- >>> import oscura as tk
291
+ >>> import oscura as osc
292
292
  >>> def my_edge_detector(data, threshold=0.5):
293
293
  ... return find_edges_custom(data, threshold)
294
- >>> tk.register_algorithm('my_edges', my_edge_detector, 'edge_detector')
294
+ >>> osc.register_algorithm('my_edges', my_edge_detector, 'edge_detector')
295
295
 
296
296
  References:
297
297
  API-006: Algorithm Override Hooks
@@ -310,7 +310,7 @@ def get_algorithm(category: str, name: str) -> Callable[..., Any]:
310
310
  The registered algorithm function.
311
311
 
312
312
  Example:
313
- >>> edge_detector = tk.get_algorithm('edge_detector', 'my_edges')
313
+ >>> edge_detector = osc.get_algorithm('edge_detector', 'my_edges')
314
314
  >>> edges = edge_detector(data)
315
315
 
316
316
  References:
@@ -329,7 +329,7 @@ def get_algorithms(category: str) -> list[str]:
329
329
  List of algorithm names.
330
330
 
331
331
  Example:
332
- >>> available = tk.get_algorithms('window_func')
332
+ >>> available = osc.get_algorithms('window_func')
333
333
  >>> print(f"Available windows: {available}")
334
334
 
335
335
  References: