Skip to main content

Shared result + provenance contract for the sleap-roots <-> Bloom pipeline.

Project description

sleap-roots-contracts

Shared result + provenance contract for the sleap-roots ↔ Bloom pipeline.

This is a small, dependency-light, Bloom-agnostic library that defines the shape of a per-scan pipeline result and its provenance (Pydantic v2 models), emits a versioned JSON Schema artifact, and ships a trait-definitions registry. The Python producers (sleap-roots-predict, sleap-roots-traits) import it; Bloom consumes the emitted schema.

It also defines the analysis-input contract — the canonical shape of the wide trait table that crosses the sleap-roots-analyze ↔ Bloom boundary. validate_analysis_input(df, *, strict=False) structurally validates that table against fixed canonical role names (genotype + optional sample_id / replicate / image_path) plus an open set of opaque numeric trait columns, returning a structured ValidationResult. It operates on a pandas DataFrame, so pandas is an optional install extra — pip install sleap-roots-contracts[pandas] — while the runtime core stays pydantic + pyyaml. Canonical example tables ship in the package (sleap_roots_contracts.examples.load_analysis_input_example(...)) so consumers can load a validating frame straight from the released wheel.

It is sub-project #1 of the sleap-roots ↔ Bloom integration program. Design and plan: docs/01-contract-library-design.md and docs/02-contract-library-plan.md.

Develop

uv sync
uv run pytest -v
uv run black --check src tests && uv run ruff check src tests

Key ideas

  • Pydantic is canonical; schema/*.json is generated and drift-guarded in CI.
  • Trait values are long-format rows (no jsonb); provenance is a jsonb blob on the source.
  • Hashes (param_hash, idempotency_key) are producer-side only; Bloom treats them as opaque strings.
  • Distributed via PyPI (no Docker image — this is a library).

Project details


Download files

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

Source Distribution

sleap_roots_contracts-0.1.0a1.tar.gz (14.7 kB view details)

Uploaded Source

Built Distribution

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

sleap_roots_contracts-0.1.0a1-py3-none-any.whl (20.5 kB view details)

Uploaded Python 3

File details

Details for the file sleap_roots_contracts-0.1.0a1.tar.gz.

File metadata

  • Download URL: sleap_roots_contracts-0.1.0a1.tar.gz
  • Upload date:
  • Size: 14.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for sleap_roots_contracts-0.1.0a1.tar.gz
Algorithm Hash digest
SHA256 0102c724e9aa9fefadcd16314debcd3b5925260b2e4f681a9f6c74a4cff25a41
MD5 7d4d46785860e470316af67cd84af097
BLAKE2b-256 091fad5ed534bca6f675f2f0b06c4665e3502e9c9027736dd24bebe991f199a9

See more details on using hashes here.

Provenance

The following attestation bundles were made for sleap_roots_contracts-0.1.0a1.tar.gz:

Publisher: publish.yml on talmolab/sleap-roots-contracts

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

File details

Details for the file sleap_roots_contracts-0.1.0a1-py3-none-any.whl.

File metadata

File hashes

Hashes for sleap_roots_contracts-0.1.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 8d203f73cffc13233aa63578ca24e8355be29d09a4f3fb08a4047c4fee19979b
MD5 018acfa0c18227604b45c4497025f668
BLAKE2b-256 f9997d584a8a3a9a34b812cf7f6a1514c2cc454073315747a102027d4c03293f

See more details on using hashes here.

Provenance

The following attestation bundles were made for sleap_roots_contracts-0.1.0a1-py3-none-any.whl:

Publisher: publish.yml on talmolab/sleap-roots-contracts

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

Supported by

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