Utilities

The bioverse.utilities package provides shared infrastructure used across adapters, datasets, benchmarks, and transforms:

  • Configuration (bioverse.utilities.config) — default paths (dataset_path, raw_path, benchmarks_path), random seed, worker count, and scratch storage. Override via environment variables such as BIOVERSE_ROOT.

  • I/O (bioverse.utilities.io) — shard serialization, parallel processing helpers, logging utilities, and the IteratorWithLength wrapper used throughout the loader pipeline.

  • Arrays & geometry (bioverse.utilities.array, bioverse.utilities.geometry, bioverse.utilities.align) — Awkward Array helpers, structural alignment, and coordinate math.

  • Constants & requirements — shared enumerations and optional-dependency checks.

Most users interact with utilities indirectly through config paths and the CLI. Extension authors may import these modules when building custom adapters or transforms.

class bioverse.utilities.io.IteratorWithLength(iterator: Iterator, length: int | None = None)[source]

Bases: Iterator

Iterator wrapper that exposes __len__ for progress tracking.

class bioverse.utilities.io.LRUCache(size: int = 5)[source]

Bases: OrderedDict

Least-recently-used cache for shard loading.