Skip to main content

Library for input/output of transition systems in a unified Markov binary (UMB) format.

Project description

umbi

Python 3.11+ License MIT PyPI Latest Tag Build Status

Library for input/output of annotated transition systems (ATSs) in a unified Markov binary (UMB) format. See the format specification for details.

Installation:

pip install umbi

Quick start

A short example where we read a umbfile into an ExplicitAts object, modify initial states, and write it back:

import umbi
ats = umbi.ats.read("in.umb")
ats.set_initial_states([ats.num_states - 1])
umbi.ats.write(ats, "out.umb")

More examples can be found in the ./examples folder.

API

umbi offers multiple levels of abstraction for working with UMB files:

TarFile and TarCoder - low-level access to umbfile contents.

ExplicitUmb - in-memory representation of a typical umbfile. Attributes are standard Python objects (lists, dicts, dataclasses) providing a deserialized view of the file contents.

ExplicitAts - format-agnostic abstraction for annotated transition systems (states, transitions, annotations). Recommended for most use cases: easiest to use programmatically and remains stable across UMB format changes.

CLI

umbi provides a basic CLI for umbfile manipulation.

Options:

  • --import-umb <path> - import umbfile as ExplicitUmb
  • --import-ats <path> - import umbfile as ExplicitAts
  • --export <path> - export to umbfile (requires --import-umb or --import-ats)
  • --log-level <LEVEL> - set logging level: DEBUG, INFO (default), WARNING, ERROR, CRITICAL

Example:

umbi --import-umb input.umb --export output.umb --log-level DEBUG

Development

(optional) create and activate a python environment:

python -m venv .venv
source .venv/bin/activate

Setup

Install development dependencies:

pip install .[dev]

Testing

Run the test suite with pytest:

python -m pytest              # run all tests
python -m pytest tests/tar/   # run specific test directory
python -m pytest -k test_name # run tests matching pattern

Current test coverage:

  • binary - serialization and binary data handling
  • datatypes - data type definitions and conversions
  • tar - tarfile I/O and utilities

Code Quality

Pre-commit hooks automatically run code quality checks before each commit. Configuration: .pre-commit-config.yaml

Set up the hooks with:

pre-commit install

Run hooks manually on all files:

pre-commit run --all-files

Individual tools can be run manually:

Ruff -- Code formatting and linting. Config: pyproject.toml ([tool.ruff])

ruff check .       # check for issues
ruff check . --fix # check and fix
ruff format .      # format code

Pyright -- Static type checking. Config: pyproject.toml ([tool.pyright])

pyright             # check entire project
pyright umbi/       # check specific directory

Release

Dependencies are pinned in the uv.lock lockfile for reproducible builds. New versions are published to PyPI via the release workflow. The workflow is triggered automatically when:

  • a new version tag is pushed (format: v*.*.*)
  • the bump version workflow completes successfully (can be run manually via GitHub actions)

The release workflow:

  1. updates the uv.lock lockfile to reflect any dependency changes
  2. builds the distribution packages
  3. publishes to PyPI via trusted publishing
  4. updates the stable branch pointer to track the latest release

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

umbi-0.2.4.tar.gz (49.6 kB view details)

Uploaded Source

Built Distribution

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

umbi-0.2.4-py3-none-any.whl (63.0 kB view details)

Uploaded Python 3

File details

Details for the file umbi-0.2.4.tar.gz.

File metadata

  • Download URL: umbi-0.2.4.tar.gz
  • Upload date:
  • Size: 49.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for umbi-0.2.4.tar.gz
Algorithm Hash digest
SHA256 50a73412dd7c08d113d278aa1caa4f48a47bed4b078b9658ae655fc564cc1b8b
MD5 0d0aea0aaacdcb6efed83e9ca9d5e484
BLAKE2b-256 ecec2215518790f478d665239844d7d7862f2f6081662e5956b7a9a6d8d98809

See more details on using hashes here.

Provenance

The following attestation bundles were made for umbi-0.2.4.tar.gz:

Publisher: release.yml on pmc-tools/umbi

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

File details

Details for the file umbi-0.2.4-py3-none-any.whl.

File metadata

  • Download URL: umbi-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 63.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for umbi-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 bbf4cb5e00531f2c4b7e6093df9636c36003719f80f308957547dcaa0ce44bfb
MD5 40b0427b0e417e752dc6d309bb9c86c0
BLAKE2b-256 e56cf6b862b87aa4884005281fe9ae074ff9cd6d26ebbb4b6e2ab9935e5e5c03

See more details on using hashes here.

Provenance

The following attestation bundles were made for umbi-0.2.4-py3-none-any.whl:

Publisher: release.yml on pmc-tools/umbi

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