Skip to main content

pisces-lite

ML-backend-agnostic core for wearable sleep data: dataset discovery and loading, accelerometer-to-spectrogram processing, cross-validation splitting, and metrics logging. It carries no model framework, though there is a JAX-accelerated option for the [jax] extra components.

Install

pip install pisces-lite

Python 3.12+. To do the processing yourself rather than read a prebuilt feature cache, install an extra — see Optional extras. The proc and jax extras require a Python version the compiled backend publishes wheels for (currently 3.12–3.14):

pip install "pisces-lite[proc]"

Getting started

from pisces_lite.datasets import DataSetObject, load_subject

# Discover datasets laid out as <dataset>/cleaned_<feature>/<subject>.csv
data_sets = DataSetObject.find_data_sets("data/")
ds = data_sets["mydata"]

# Load one subject: (accelerometer, PSG) frames with standardised columns
subject = load_subject(ds, ds.ids[0])

Datasets are described by an optional data_set.json next to the data; it sets per-feature timestamp units, accelerometer scaling, PSG stage mappings, CSV delimiters, and subject-id patterns. Non-standard layouts can ship a pisces_lite_adapter.py exposing load_data_sets(root, **kwargs).

Configure the processing pipeline and turn raw accelerometer into spectrograms:

from pisces_lite.proc import ProcessingConfig

config = ProcessingConfig.from_dict({"type": "nufft", "fs": 32.0})
X = config.apply(accel_array)   # (T, F) or (T, F, C) with spectral_channels

Split subjects and score folds:

from pisces_lite.cv import CVConfig, iter_folds
from pisces_lite.metrics import MetricsConfig, MetricsLogger

cv = CVConfig(mode="loso", train_sets=["mydata"], test_sets=["mydata"])
for fold in iter_folds(cv, data_sets):
    ...  # train on fold.train_subjects, evaluate fold.test_subjects

Optional extras

The base install never pulls a C++ toolchain. Add an extra only when you need the processing pipeline itself.

Extra Install What it adds Use when
proc pip install "pisces-lite[proc]" arcascope-senpy (import name senpy; compiled pybind11 + finufft), the CPU streaming/cpu NUFFT backends You are turning raw accelerometer data into spectrograms
jax pip install "pisces-lite[jax]" arcascope-senpy[jax] and JAX, adding the jax NUFFT backend You want GPU-batched spectrogram extraction
dev pip install "pisces-lite[dev]" pytest You are running the test suite

Working from a prebuilt feature cache — a training or inference host that only reads cv, metrics, model_io, and ProcessingConfig — needs no extra. pisces_lite.proc resolves its pipeline classes lazily, so importing a ProcessingConfig does not import senpy; touching a pipeline class without the extra raises a clear error naming the extra to install.

Release files for pisces-lite 3.0.0

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

Source distribution (sdist)

Source distribution for pisces-lite 3.0.0
File Size Uploaded
pisces_lite-3.0.0.tar.gz 56.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pisces-lite 3.0.0
File Interpreter ABI Platform
pisces_lite-3.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 111.5 kB

Release files / pisces_lite-3.0.0.tar.gz

Download URL pisces_lite-3.0.0.tar.gz
Size 56.6 kB
Tags Source
SHA-256 checksum
How to use checksums
aa8009a6287d4cad5195eb308e580b41b331b8b07091b1e2544886b44b1b622c
BLAKE2b-256 checksum
How to use checksums
7bf05ca91e48ff085daf95e9c487a587319ad41fe50511152c1c137485bb074a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 24, 2026.

Transparency log

Release files / pisces_lite-3.0.0-py3-none-any.whl

Download URL pisces_lite-3.0.0-py3-none-any.whl
Size 55.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cdb49d2e1fd65bb87f35b875b199baede00cabd52c45d6d27a165a53ba455fc5
BLAKE2b-256 checksum
How to use checksums
b876293d939797421c18514d08b11caf5e8082f7e0e2518a538afb0517b4bfd7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 24, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

3.0.0 This release

2 release files

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