|
1 | | -# tsontology API reference |
| 1 | +# EchoTime API reference |
2 | 2 |
|
3 | 3 | ## core profiling |
4 | 4 |
|
|
8 | 8 |
|
9 | 9 | **Purpose:** Primary entry point. Profile an entire dataset as a dataset. |
10 | 10 |
|
11 | | -**Why this API exists:** The core design choice of tsontology is that the object of interest is the dataset, not just a single series. This function aggregates unit-level signals, multivariate structure, cohort variation, and observation characteristics into one profile. |
| 11 | +**Why this API exists:** The core design choice of EchoTime is that the object of interest is the dataset, not just a single series. This function aggregates unit-level signals, multivariate structure, cohort variation, and observation characteristics into one profile. |
12 | 12 |
|
13 | 13 | **When to use it:** Use when you want the ontology axes, archetypes, task hints, reliability, and dataset-card outputs for a whole dataset or cohort. |
14 | 14 |
|
|
206 | 206 |
|
207 | 207 | **Purpose:** Represent sparse event streams such as alarms, coded events, transactions, or interventions. |
208 | 208 |
|
209 | | -**Why this API exists:** A stream of timestamped events is not the same as a dense sampled signal. This wrapper lets tsontology estimate burstiness, event-type diversity, and event-stream archetypes without pretending the data are regular arrays. |
| 209 | +**Why this API exists:** A stream of timestamped events is not the same as a dense sampled signal. This wrapper lets echotime estimate burstiness, event-type diversity, and event-stream archetypes without pretending the data are regular arrays. |
210 | 210 |
|
211 | 211 | **When to use it:** Use for sparse operational events, treatment events, alarms, clicks, or transactional logs. |
212 | 212 |
|
|
236 | 236 |
|
237 | 237 | **Why this API exists:** An ontology-driven library must make its schema inspectable and versioned. These functions let downstream tools, dataset cards, and documentation stay aligned with the real axis/subdimension/proxy map. |
238 | 238 |
|
239 | | -**When to use it:** Use when building dashboards, validators, reports, or benchmark cards around tsontology. |
| 239 | +**When to use it:** Use when building dashboards, validators, reports, or benchmark cards around echotime. |
240 | 240 |
|
241 | 241 | **Returns:** Schema dictionary or typed schema tuple |
242 | 242 |
|
|
259 | 259 |
|
260 | 260 | **Signature:** `register_adaptor(adaptor); register_plugin(plugin); clear_custom_extensions()` |
261 | 261 |
|
262 | | -**Purpose:** Extend tsontology to new data containers and domain-specific metrics. |
| 262 | +**Purpose:** Extend echotime to new data containers and domain-specific metrics. |
263 | 263 |
|
264 | 264 | **Why this API exists:** Cross-disciplinary infrastructure must be extensible. Adaptors let the package ingest new object types; plugins let communities add domain metrics without forking the ontology core. |
265 | 265 |
|
|
315 | 315 |
|
316 | 316 | **Signature:** `case_gallery(domain=None, audience=None, environment=None, format='markdown')` |
317 | 317 |
|
318 | | -**Purpose:** Browse high-visibility cross-disciplinary use cases where tsontology fits naturally. |
| 318 | +**Purpose:** Browse high-visibility cross-disciplinary use cases where echotime fits naturally. |
319 | 319 |
|
320 | 320 | **Why this API exists:** New users often understand a tool fastest through concrete cases instead of abstract API descriptions. The case gallery shows popular time-series settings such as web traffic, retail demand, energy load, wearables, ICU monitoring, and fMRI. |
321 | 321 |
|
|
364 | 364 |
|
365 | 365 | ### `hot_case_gallery / similarity_playbook / project_homepage_html / project_playground_html` |
366 | 366 |
|
367 | | -**Signature:** `hot_case_gallery(...); similarity_playbook(...); project_homepage_html(version='0.12.0'); project_playground_html(version='0.12.0')` |
| 367 | +**Signature:** `hot_case_gallery(...); similarity_playbook(...); project_homepage_html(version='0.17.0'); project_playground_html(version='0.17.0')` |
368 | 368 |
|
369 | 369 | **Purpose:** Provide shareable, high-attention case ideas plus a static project-homepage starting point. |
370 | 370 |
|
|
408 | 408 |
|
409 | 409 | **Inspect these outputs:** |
410 | 410 |
|
411 | | -- similarity_score |
| 411 | +- reference_metrics |
| 412 | +- component_mean |
412 | 413 | - component_scores |
413 | 414 | - to_summary_card_markdown() |
414 | 415 | - to_narrative_report() |
|
419 | 420 |
|
420 | 421 | **Signature:** `compare_profiles(left, right, *, left_name='left profile', right_name='right profile') -> SimilarityReport` |
421 | 422 |
|
422 | | -**Purpose:** Compare two tsontology profiles or raw datasets at the ontology-axis level. |
| 423 | +**Purpose:** Compare two echotime profiles or raw datasets at the ontology-axis level. |
423 | 424 |
|
424 | 425 | **Why this API exists:** Sometimes raw units and scales differ too much for direct shape matching, but the datasets are still structurally analogous. Profile similarity answers that higher-level question. |
425 | 426 |
|
|
462 | 463 |
|
463 | 464 | **Inspect these outputs:** |
464 | 465 |
|
465 | | -- similarity_score |
| 466 | +- component_mean |
| 467 | +- pearson_r |
466 | 468 | - shape_similarity |
467 | 469 | - trend_similarity |
468 | 470 | - spectral_similarity |
469 | 471 |
|
470 | 472 | **Recommended environments:** notebook, python_script, pandas_pipeline |
471 | 473 |
|
| 474 | +### `ncc_sequence / max_ncc / best_shift / sbd / independent_max_ncc / independent_sbd / acf_distance / periodogram_distance / trend_distance / ordinal_pattern_js_distance / linear_trend_model_distance / lcss_similarity / lcss_distance / edr_distance / erp_distance / twed_distance` |
| 475 | + |
| 476 | +**Signature:** `ncc_sequence(x, y, *, normalize=True) -> tuple[np.ndarray, np.ndarray]; max_ncc(...) -> float; best_shift(...) -> int; sbd(...) -> float; independent_max_ncc(...) -> float; independent_sbd(...) -> float; acf_distance(x, y, *, max_lag=10) -> float; periodogram_distance(x, y, *, n_coeffs=32) -> float; trend_distance(x, y) -> float; ordinal_pattern_js_distance(x, y, *, order=3, delay=1) -> float; linear_trend_model_distance(x, y) -> float; lcss_similarity(x, y, *, epsilon=1.0, window=None, mode='exact') -> float; lcss_distance(x, y, *, epsilon=1.0, window=None, mode='exact') -> float; edr_distance(x, y, *, epsilon=1.0, normalized=True, window=None, mode='exact') -> float; erp_distance(x, y, *, gap_value=0.0, window=None, mode='exact') -> float; twed_distance(x, y, *, lambda_=1.0, nu=0.001, t_x=None, t_y=None, window=None, mode='exact') -> float` |
| 477 | + |
| 478 | +**Purpose:** Expose the extracted low-level similarity primitives directly when you need one explicit metric instead of a report bundle, including a fast screening path for the elastic distances. |
| 479 | + |
| 480 | +**Why this API exists:** EchoTime's main surface is intentionally report-first, but advanced users still need direct access to shift-aware, rhythm-aware, and elastic distances for retrieval, thresholding, and custom pipelines. |
| 481 | + |
| 482 | +**When to use it:** Use when you already know which similarity family you need and want a scalar score or lag estimate to plug into downstream logic; use `mode='fast'` for shortlist screening and `mode='exact'` for final reporting. |
| 483 | + |
| 484 | +**Returns:** NumPy arrays, scalar similarities, scalar distances, or a best-lag integer depending on the function |
| 485 | + |
| 486 | +**Accepted inputs / context:** |
| 487 | + |
| 488 | +- 1D arrays |
| 489 | +- 2D multichannel arrays |
| 490 | +- optional timestamps for TWED |
| 491 | +- optional gap, tolerance, or band-width hyperparameters for elastic methods |
| 492 | +- `mode='fast'` for shortlist screening, `mode='exact'` for final scoring |
| 493 | + |
| 494 | +**Inspect these outputs:** |
| 495 | + |
| 496 | +- the returned scalar score or distance |
| 497 | +- the lag array from ncc_sequence |
| 498 | +- best_shift for lead-lag interpretation |
| 499 | + |
| 500 | +**Recommended environments:** notebook, python_script, ml_benchmark, pandas_pipeline |
| 501 | + |
472 | 502 | ## agent driving |
473 | 503 |
|
474 | 504 | ### `AgentDriver / agent_drive / agent_context` |
475 | 505 |
|
476 | 506 | **Signature:** `AgentDriver(goal='understand_dataset', budget='lean|balanced|deep', ...); agent_drive(data, reference=None, goal=..., budget=...); agent_context(profile_or_similarity_report, budget='lean')` |
477 | 507 |
|
478 | | -**Purpose:** Let an agent or application choose the cheapest useful tsontology workflow and export a compact context bundle. |
| 508 | +**Purpose:** Let an agent or application choose the cheapest useful EchoTime workflow and export a compact context bundle. |
479 | 509 |
|
480 | 510 | **Why this API exists:** LLM agents often waste tokens by running too many analyses and by carrying oversized intermediate reports. This API chooses a small workflow first, stops early when the signal is already clear, and compresses the result into a reusable context payload. |
481 | 511 |
|
482 | | -**When to use it:** Use when tsontology sits inside an agent loop, a notebook assistant, a retrieval pipeline, or a batch report generator that needs compact summaries. |
| 512 | +**When to use it:** Use when echotime sits inside an agent loop, a notebook assistant, a retrieval pipeline, or a batch report generator that needs compact summaries. |
483 | 513 |
|
484 | 514 | **Returns:** AgentDriveResult or compact context dict/markdown/json |
485 | 515 |
|
|
0 commit comments