Skip to main content
Pre-release

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 StandardAnalysis class
  • 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). 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 uint16 data).

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)

  1. GitHub environment: create an environment named pypi (Settings -> Environments -> New environment). No protection rules required.
  2. 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

Release steps

  1. On the test branch, bump the version in pyproject.toml so 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"
    
  2. Tag the release and push branch + tag. The tag (without the leading v) must match the version in pyproject.toml — the workflow verifies this and fails otherwise:

    git tag v3.0a3
    git push origin test v3.0a3
    
  3. Watch the run at https://github.com/danae-dm/apantias/actions — it checks the tag/version match, builds with uv build, and publishes with uv publish --trusted-publishing always.

  4. 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 be danae-dm, environment must be pypi). Fix it and re-run the failed job from the Actions page.

  • Tag/version mismatch: fix the version in pyproject.toml or 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.0b2

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

Source distribution (sdist)

Source distribution for apantias 3.0b2
File Size Uploaded Provenance Actions
apantias-3.0b2.tar.gz 59.9 kB Without provenance Details for apantias-3.0b2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for apantias 3.0b2
File Interpreter ABI Platform Actions
apantias-3.0b2-py3-none-any.whl Python 3 none any Details for apantias-3.0b2-py3-none-any.whl

Total release size: 88.3 kB

Release files / apantias-3.0b2.tar.gz

Download URL apantias-3.0b2.tar.gz
Size 59.9 kB
Tags Source
SHA-256 checksum
How to use checksums
adf41018c7bd9c45a6f8db47c7f28d20ca2c0254b9d71c957a404dc06ad22d87
BLAKE2b-256 checksum
How to use checksums
b28dd6d2910d3e8f178c50903023f7ac2cfb0ea37214dcff91f3ce44e69cccf9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","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.0b2-py3-none-any.whl

Download URL apantias-3.0b2-py3-none-any.whl
Size 28.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b8bfffab0c4932e429e034ddae699265cb4e2da6b6cb162dbb5f96315f382529
BLAKE2b-256 checksum
How to use checksums
7892a3eb8e7c3801936042ca5042680e2a37c2183f4415ad9edf3f115bf3c96e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","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.0b2

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.

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