Skip to main content

cs-temporal

Zero-dependency bitemporal evidence geometry, autonomous changepoint detection (Max-Q_cp), live retraction purge, and W3C SPARQL 1.1 Rule_H0f export.

Part of the ConductScience Foundation open-source tooling initiative. For live search across clinical trial timelines in medicine, see https://conductscience.org/search?mode=time.

Why cs-temporal

Standard meta-analysis pools trials as if clinical evidence were timeless. When early positive trials are followed by null or negative trials, or when a pivotal trial is later retracted, classical random-effects pooling absorbs the shift into between-study variance (tau^2) and obscures when the conclusion changed.

cs-temporal computes exact closed-form bitemporal evidence geometry with zero runtime dependencies:

  • Causal-cone "As Of" evaluation: Strictly excludes studies published after as_of and excludes retracted studies once retracted_day <= as_of.
  • Exact DerSimonian-Laird random-effects & fixed-effect estimates: mu_FE, mu_RE, se_RE, 95% CI, Cochran's Q_tot, tau^2, I^2.
  • Autonomous Max-Q_cp changepoint discovery: Scans all distinct chronological split dates with deterministic earliest-t* tie-breaking (1e-9 tolerance) and computes temporal heterogeneity share R^2_time = Q_cp / Q_tot.
  • Tie-preserving chronological permutation test: Evaluates unrounded Q_cp and excess R^2_time above the exact date-block permutation null.
  • Leave-one-out counterfactual replay: Recomputes the full timeline with any study excluded (without=[...]).
  • W3C Turtle RDF & SPARQL 1.1 Rule_H0f export: Emit standards-compliant RDF graphs compatible with Oxigraph, Jena, Virtuoso, or RDFLib.
  • Multi-modal v0.2.0 extensions (cs_temporal.multimodal):
    • analyze_ivw_shape: Overdispersion-scaled quasi-likelihood BIC step-vs-slope router (step_dominant, slope_dominant, mixed_step_slope, flat), within-era random-effects contrast (Q_cp_re), and comparator-switch confounding guard (comparator_by_id).
    • analyze_continuous_series: SE-free continuous BIC cliff-vs-ramp router with automatic chronological sorting, n-normalized Kruskal-Wallis, and boilerplate copy-paste detection.
    • synchronized_panel_permutation: Tie-preserving synchronized column-time permutation across balanced cross-sectional panels (for stationary or first-differenced time series).

Install

pip install cs-temporal

Quick start (CLI)

# Run built-in Hydroxychloroquine COVID-19 timeline before and after the 27 Dec 2024 retraction
cs-temporal demo hcq --as-of 2024-12-26
cs-temporal demo hcq --as-of 2024-12-27

# Analyze your own CSV (columns: id,day,y,se,label,retracted_day)
cs-temporal analyze studies.csv --as-of 2025-01-01 --perm 1000 --json

# Export W3C Turtle RDF
cs-temporal export-rdf studies.csv --topic my-drug --out graph.ttl

Quick start (Python)

from cs_temporal import DEMO_SERIES, build_replay, tie_preserving_permutation_test

pre = build_replay(DEMO_SERIES["hcq"], as_of="2024-12-26")
post = build_replay(DEMO_SERIES["hcq"], as_of="2024-12-27")
print(pre.current.status, pre.current.q_cp, pre.current.t_star)
print(post.current.status, post.current.q_cp, post.current.k_purged)

Zero-install browser app

Open docs/index.html locally (or via GitHub Pages) to paste any CSV, scrub the As of date on a stepped cumulative meta-analysis chart with 95% confidence band, run live leave-one-out sensitivity checks, and export W3C Turtle RDF completely offline in your browser.

License

Apache-2.0.

Metadata

Release files for cs-temporal 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cs-temporal 0.2.1
File Size Uploaded Provenance Actions
cs_temporal-0.2.1.tar.gz 22.4 kB Without provenance Details for cs_temporal-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cs-temporal 0.2.1
File Interpreter ABI Platform Actions
cs_temporal-0.2.1-py3-none-any.whl Python 3 none any Details for cs_temporal-0.2.1-py3-none-any.whl

Total release size: 42.9 kB

Release files / cs_temporal-0.2.1.tar.gz

Download URL cs_temporal-0.2.1.tar.gz
Size 22.4 kB
Tags Source
SHA-256 checksum
How to use checksums
9e7f37737b7684ee722f5c51d76f7397456256d8ca2b9813352066272b7e5cf8
BLAKE2b-256 checksum
How to use checksums
e39b79bae2742c45b3114252c2eb0544e67a76504cd3f601a58a70ba8b2b5994
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Release files / cs_temporal-0.2.1-py3-none-any.whl

Download URL cs_temporal-0.2.1-py3-none-any.whl
Size 20.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
67d62c7e68f8b907bf9e4bbac3b6ac4bb7499db76f66e71c95d62b37ea078f0c
BLAKE2b-256 checksum
How to use checksums
d7c92ffb2e885d109285fa2bea4d3f8915053fa35db17066064eaa0d8e2513fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Security for cs-temporal 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page