Skip to main content

radiens-qc

radiens-qc turns a Radiens recording into an answerable question: is this data good enough to use?

Give it a recording and a VidereClient. It configures read-time DSP so the KPIs reflect the spike band, walks the recording in windows, and returns a report: per-channel SNR / noise floor / event rate, a quality tier per channel, and a single-letter grade — plus a one-page figure you can hand to a PI.

Quick start

from pathlib import Path

from radiens_core import VidereClient
from radiens_qc import compute_report, save_report

vc = VidereClient()
report = compute_report(vc, Path("/data/rec01.xdat"), source="exp/day3")

print(report.grade())            # "A"
print(report.median("snr"))      # 6.2
print(report.quality_counts())   # {"good": 26, "fair": 4, "poor": 1, "dead": 1}

save_report(report, Path("reports"))   # -> reports/rec01/

Comparing sessions

save_report writes a self-describing folder, and the comparative report is built from those folders — no server, no KPI recompute:

from radiens_qc.compare import ComparativeReport, load_session_summaries, save_comparative_report

summaries = load_session_summaries(Path("reports"))
save_comparative_report(ComparativeReport.from_summaries(summaries), Path("reports"))

Where recordings come from is not this package's problem

compute_report takes either a local Path or an already-linked DatasetMetadata. Given a path it links the file itself — linking is idempotent server-side, so passing a path for an already-linked file costs nothing. Fetching bytes from Drive, S3, or a lab share stays with the caller, which is what lets the same report code serve any project.

A bare str is deliberately not accepted: in radiens-core a string means a dataset id, not a path. Wrap yours in Path(...).

What gets written

save_report(report, out_dir) creates <out_dir>/<base_name>/:

File Contents
meta.json Provenance, thresholds, grade, per-metric summary stats, schema_version
channels.csv One row per channel: geometry, per-metric values, quality tier
time_series.csv Across-channel median per metric per window (human-readable)
matrices.npz Full (n_windows, n_channels) arrays — what makes a reloaded report re-plottable
<base_name>_quality.png The composite page

load_report reads folders written by any version; pre-schema_version folders load with empty matrices, which blanks the temporal panels rather than failing.

Plotting

Plot functions are pure — they build and return matplotlib Figure objects and never touch the filesystem, so figure routing stays yours:

from radiens_qc import plot_report, plot_report_panels

fig = plot_report(report)                 # composite page
panels = plot_report_panels(report)       # {"spatial_snr": Figure, "ranked_bar": Figure, ...}

The composite is laid out as an exact 8.5×11in page. Save it with bbox_inches=None — matplotlib's "tight" default crops the page sizing away. save_report already does this.

Installation

pip install radiens-qc

or, with uv:

uv add radiens-qc

Requires Python 3.12+ and a reachable Radiens server for compute_report; everything downstream of a saved report folder (load_report, the plot functions, radiens_qc.compare) works offline.

License

See LICENSE.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

radiens_qc-0.0.2.tar.gz (53.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

radiens_qc-0.0.2-py3-none-any.whl (46.9 kB view details)

Uploaded Python 3

File details

Details for the file radiens_qc-0.0.2.tar.gz.

File metadata

  • Download URL: radiens_qc-0.0.2.tar.gz
  • Upload date:
  • Size: 53.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for radiens_qc-0.0.2.tar.gz
Algorithm Hash digest
SHA256 e66113785359c8db889622f54144749c63ebc7b631de1b8305b19a4b35eb2398
MD5 7b20b53c8bb22fd7d7c57e92dda62c3c
BLAKE2b-256 257ddf89b18974b43b0dbbb254658e67ebcb6456af838cfa5bf225b25a4899fc

See more details on using hashes here.

Provenance

The following attestation bundles were made for radiens_qc-0.0.2.tar.gz:

Publisher: publish.yml on NeuroNexus/radiens-qc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file radiens_qc-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: radiens_qc-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 46.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for radiens_qc-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 315ae8c58513f9fe012986f8eba7bfc6c13b525feddaf333d8265b859ec258de
MD5 d2469e1da47a6f8a6b5c9dc93331e2d7
BLAKE2b-256 fbfa98f74d11e49ba3c07ecb3193190d690ada4e0fc4bc6dc4d2ded1f25dd486

See more details on using hashes here.

Provenance

The following attestation bundles were made for radiens_qc-0.0.2-py3-none-any.whl:

Publisher: publish.yml on NeuroNexus/radiens-qc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 files

0.0.1

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page