This release is a pre-release and may not be stable for production use.
apantias
Tools for analysis of data from the DANAE experiment at HEPHY Vienna.
apantias ingests raw detector data, converts it to chunked zarr storage, and
runs a configurable, dask-based analysis pipeline (including slope fitting)
that scales across a local cluster. Configuration is centralized in a typed
settings object, and a preflight check validates the whole setup before dask
is started.
Features
- Data conversion: binary raw data -> HDF5 -> zarr (
bin_to_h5,h5_to_zarr) - Dask-backed analysis: parallel processing with a managed local cluster
- Central settings: all parameters live in a single settings instance,
passed to and owned by the
StandardAnalysisclass - Preflight checks: validates configuration and resources before the run
- Slope fitting: with fit parameters configured in the settings
Data layout
Arrays are stored as (n_frames, n_rows, n_reps, n_cols), indexed as
(frame_idx, row_idx, rep_idx, col_idx). n_rows is the number of readout
lines per frame (axis 1); n_cols is the pixels per readout line (axis 3).
Raw data is stored as uint16.
Requirements
- Python 3.12
- Minimum 2 GB RAM per physical core. A chunk size of 100 MB should
reliably work; lower it if RAM runs low (chunk size refers to the raw
uint16data).
Installation
Install from PyPI:
uv pip install apantias
or with pip:
pip install apantias
Quick start
from pathlib import Path
from apantias import settings, standard
# Load settings from a YAML file (writes a default.yaml first if none exists)
config = settings.load_config(Path("default.yaml"))
# Hand the settings to the analysis: preflight checks run first, then a dask
# cluster is started; the client/cluster are closed again after run()
analysis = standard.StandardAnalysis(config)
analysis.run()
StandardAnalysis also accepts a path to a YAML config file
(standard.StandardAnalysis("default.yaml")) or no argument to use
default.yaml from the current directory.
All tunable parameters (chunk sizes, dask temp paths, fit thresholds, ...)
live in the frozen AppSettings structure — see the module docstring in
src/apantias/settings.py. Raw binary data can be converted with
apantias.io.bin_to_h5 and apantias.io.h5_to_zarr.
Development
This project uses uv for dependency management:
uv sync # install into .venv (including the package itself)
uv run pytest # run tests (deselect slow ones: -m "not slow")
uv run ruff check . # lint
uv run ruff format . # format
Publishing a new release
Releases are published to PyPI automatically by GitHub Actions
(.github/workflows/python-publish.yml) when a version tag v* is pushed.
Publishing uses Trusted Publishing
(OIDC) — no API token needed.
Prerequisites (one-time setup)
- GitHub environment: create an environment named
pypi(Settings -> Environments -> New environment). No protection rules required. - PyPI publisher: on pypi.org, register the trusted publisher
(Account settings -> Publishing -> "Add a new pending publisher"):
- PyPI project name:
apantias - Owner:
danae-dm - Repository:
apantias - Workflow filename:
python-publish.yml - Environment:
pypi
- PyPI project name:
Release steps
-
On the
testbranch, bump the version inpyproject.tomlso it is unique (PyPI never allows re-uploading the same version):git checkout test git pull # edit version = "..." in pyproject.toml, e.g. 3.0a2 -> 3.0a3 git commit -am "Bump version to 3.0a3"
-
Tag the release and push branch + tag. The tag (without the leading
v) must match the version inpyproject.toml— the workflow verifies this and fails otherwise:git tag v3.0a3 git push origin test v3.0a3
-
Watch the run at https://github.com/danae-dm/apantias/actions — it checks the tag/version match, builds with
uv build, and publishes withuv publish --trusted-publishing always. -
Verify the new version on https://pypi.org/project/apantias/
If a run fails
-
invalid-publisher(422) from PyPI: the trusted publisher config on pypi.org does not match the workflow claims (owner must bedanae-dm, environment must bepypi). Fix it and re-run the failed job from the Actions page. -
Tag/version mismatch: fix the version in
pyproject.tomlor the tag, then delete and re-push the tag:git push origin :refs/tags/v3.0a3 git tag -f v3.0a3 git push origin v3.0a3
Changelog
See CHANGELOG.md for development history and notes.
License
MIT — see LICENSE.
Metadata
Release files for apantias 3.0b3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| apantias-3.0b3.tar.gz | 68.9 kB | Without provenance | Details for apantias-3.0b3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| apantias-3.0b3-py3-none-any.whl | Python 3 | none | any | Details for apantias-3.0b3-py3-none-any.whl |
Total release size: 103.9 kB
Release files / apantias-3.0b3.tar.gz
| Download URL | apantias-3.0b3.tar.gz |
|---|---|
| Size | 68.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
afa4dfea285938d31fa3083f2d530932720d1e6550358335e4567efb479c3870
|
|
BLAKE2b-256 checksum How to use checksums |
45cac87cfde9bea867ea983b8eef9806d9da19867c756957475781dea092293a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.4 {"installer":{"name":"uv","version":"0.13.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / apantias-3.0b3-py3-none-any.whl
| Download URL | apantias-3.0b3-py3-none-any.whl |
|---|---|
| Size | 35.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ec31052c9fd67f1f41a51fe8db7eb983ed059f15ad66f101171cdde54692c385
|
|
BLAKE2b-256 checksum How to use checksums |
a5c446fe2211789e42401d6df6ef54b91a0b14663d9ce293923fb1347c71b837
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.4 {"installer":{"name":"uv","version":"0.13.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for apantias 3.0b3
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.