Coverage for src / tracekit / core / __init__.py: 100%
22 statements
« prev ^ index » next coverage.py v7.13.1, created at 2026-01-11 23:04 +0000
« prev ^ index » next coverage.py v7.13.1, created at 2026-01-11 23:04 +0000
1"""TraceKit core module.
3Provides core data types, configuration, exception handling, and logging infrastructure.
4"""
6from tracekit.core.audit import (
7 AuditEntry,
8 AuditTrail,
9 get_global_audit_trail,
10 record_audit,
11)
12from tracekit.core.cache import (
13 CacheEntry,
14 CacheStats,
15 TraceKitCache,
16 clear_cache,
17 get_cache,
18 show_cache_stats,
19)
20from tracekit.core.config import (
21 DEFAULT_CONFIG,
22 get_config_value,
23 load_config,
24 save_config,
25 validate_config,
26)
27from tracekit.core.correlation import (
28 CorrelationContext,
29 generate_correlation_id,
30 get_correlation_id,
31 set_correlation_id,
32 with_correlation_id,
33)
34from tracekit.core.cross_domain import (
35 DOMAIN_AFFINITY,
36 CorrelationResult,
37 CrossDomainCorrelator,
38 CrossDomainInsight,
39 correlate_results,
40)
41from tracekit.core.debug import (
42 DebugLevel,
43 debug_context,
44 disable_debug,
45 enable_debug,
46 get_debug_level,
47 is_debug_enabled,
48)
49from tracekit.core.edge_cases import (
50 EmptyTraceError,
51 InsufficientSamplesError,
52 SignalQualityReport,
53 check_signal_quality,
54 check_single_sample,
55 handle_empty_trace,
56 sanitize_signal,
57 validate_signal,
58)
59from tracekit.core.exceptions import (
60 AnalysisError,
61 ConfigurationError,
62 ExportError,
63 FormatError,
64 InsufficientDataError,
65 LoaderError,
66 SampleRateError,
67 TraceKitError,
68 UnsupportedFormatError,
69 ValidationError,
70)
71from tracekit.core.gpu_backend import (
72 GPUBackend,
73 gpu,
74)
75from tracekit.core.lazy import (
76 LazyAnalysisResult,
77 LazyComputeStats,
78 LazyDict,
79 LazyResult,
80 get_lazy_stats,
81 lazy,
82 reset_lazy_stats,
83)
84from tracekit.core.log_query import (
85 LogQuery,
86 LogRecord,
87 query_logs,
88)
89from tracekit.core.logging import (
90 ErrorContextCapture,
91 configure_logging,
92 format_timestamp,
93 get_logger,
94 log_exception,
95 set_log_level,
96)
97from tracekit.core.memoize import (
98 array_hash,
99 memoize_analysis,
100)
101from tracekit.core.memory_guard import (
102 MemoryGuard,
103 can_allocate,
104 get_memory_usage_mb,
105 get_safe_chunk_size,
106 safe_array_size,
107)
108from tracekit.core.memory_monitor import (
109 MemoryMonitor,
110 MemorySnapshot,
111 ProgressMonitor,
112 ProgressWithMemory,
113 monitor_memory,
114)
115from tracekit.core.memory_progress import (
116 MemoryLogEntry,
117 MemoryLogger,
118 create_progress_callback_with_logging,
119 enable_memory_logging_from_cli,
120 log_memory,
121)
122from tracekit.core.performance import (
123 PerformanceCollector,
124 PerformanceContext,
125 PerformanceRecord,
126 clear_performance_data,
127 get_performance_records,
128 get_performance_summary,
129 timed,
130)
131from tracekit.core.progress import (
132 CancellationToken,
133 CancelledError,
134 ProgressCallback,
135 ProgressTracker,
136 check_memory_available,
137 create_progress_tracker,
138 create_simple_progress,
139 estimate_memory_usage,
140 warn_memory_usage,
141)
142from tracekit.core.provenance import (
143 MeasurementResultWithProvenance,
144 Provenance,
145 compute_input_hash,
146 create_provenance,
147)
148from tracekit.core.results import (
149 AnalysisResult,
150 FFTResult,
151 FilterResult,
152 MeasurementResult,
153 WaveletResult,
154)
155from tracekit.core.types import (
156 DigitalTrace,
157 ProtocolPacket,
158 Trace,
159 TraceMetadata,
160 WaveformTrace,
161)
163__all__ = [
164 "DEFAULT_CONFIG",
165 "DOMAIN_AFFINITY",
166 "AnalysisError",
167 # Results (API-005)
168 "AnalysisResult",
169 # Audit (LOG-009)
170 "AuditEntry",
171 "AuditTrail",
172 # Cache (MEM-029, MEM-031)
173 "CacheEntry",
174 "CacheStats",
175 "CancellationToken",
176 "CancelledError",
177 "ConfigurationError",
178 "CorrelationContext",
179 # Cross-domain correlation (CORE-007)
180 "CorrelationResult",
181 "CrossDomainCorrelator",
182 "CrossDomainInsight",
183 "DebugLevel",
184 "DigitalTrace",
185 # Edge cases (EDGE-001, EDGE-002, EDGE-003)
186 "EmptyTraceError",
187 "ErrorContextCapture",
188 "ExportError",
189 "FFTResult",
190 "FilterResult",
191 "FormatError",
192 # GPU Backend (PERF-001 through PERF-004)
193 "GPUBackend",
194 "InsufficientDataError",
195 "InsufficientSamplesError",
196 # Lazy evaluation (PERF-002, MEM-010, API-012)
197 "LazyAnalysisResult",
198 "LazyComputeStats",
199 "LazyDict",
200 "LazyResult",
201 "LoaderError",
202 # Log Query (LOG-010)
203 "LogQuery",
204 "LogRecord",
205 "MeasurementResult",
206 # Provenance (API-011)
207 "MeasurementResultWithProvenance",
208 # Memory guards (MEM-010, MEM-015, MEM-020)
209 "MemoryGuard",
210 # Memory logging (MEM-025)
211 "MemoryLogEntry",
212 "MemoryLogger",
213 # Memory monitoring
214 "MemoryMonitor",
215 "MemorySnapshot",
216 "PerformanceCollector",
217 "PerformanceContext",
218 "PerformanceRecord",
219 # Progress (PROG-001, PROG-002, PROG-003)
220 "ProgressCallback",
221 "ProgressMonitor",
222 "ProgressTracker",
223 "ProgressWithMemory",
224 "ProtocolPacket",
225 "Provenance",
226 "SampleRateError",
227 "SignalQualityReport",
228 "Trace",
229 "TraceKitCache",
230 # Exceptions
231 "TraceKitError",
232 # Types
233 "TraceMetadata",
234 "UnsupportedFormatError",
235 "ValidationError",
236 "WaveformTrace",
237 "WaveletResult",
238 # Memoization (PERF-001)
239 "array_hash",
240 "can_allocate",
241 "check_memory_available",
242 "check_signal_quality",
243 "check_single_sample",
244 "clear_cache",
245 "clear_performance_data",
246 "compute_input_hash",
247 # Logging (LOG-001, LOG-002, LOG-003, LOG-005, LOG-008)
248 "configure_logging",
249 "correlate_results",
250 "create_progress_callback_with_logging",
251 "create_progress_tracker",
252 "create_provenance",
253 "create_simple_progress",
254 "debug_context",
255 "disable_debug",
256 # Debug (LOG-007)
257 "enable_debug",
258 "enable_memory_logging_from_cli",
259 "estimate_memory_usage",
260 "format_timestamp",
261 "generate_correlation_id",
262 "get_cache",
263 "get_config_value",
264 # Correlation (LOG-004)
265 "get_correlation_id",
266 "get_debug_level",
267 "get_global_audit_trail",
268 "get_lazy_stats",
269 "get_logger",
270 "get_memory_usage_mb",
271 "get_performance_records",
272 "get_performance_summary",
273 "get_safe_chunk_size",
274 "gpu",
275 "handle_empty_trace",
276 "is_debug_enabled",
277 "lazy",
278 # Config
279 "load_config",
280 "log_exception",
281 "log_memory",
282 "memoize_analysis",
283 "monitor_memory",
284 "query_logs",
285 "record_audit",
286 "reset_lazy_stats",
287 "safe_array_size",
288 "sanitize_signal",
289 "save_config",
290 "set_correlation_id",
291 "set_log_level",
292 "show_cache_stats",
293 # Performance (LOG-006)
294 "timed",
295 "validate_config",
296 "validate_signal",
297 "warn_memory_usage",
298 "with_correlation_id",
299]