Skip to main content

Tinto logo Tinto

PyPI Status Build Status Documentation Status License: MIT Code Coverage

How long does a self-stabilizing graph coloring take to settle? Tinto measures it with a Numba-compiled Monte Carlo over pluggable graphs, guards, schedulers and recoloring rules, down to the variance and skewness of the stabilization time. For the conflict-guard rule under the random central daemon, it also provides exact results.

Features

  • Numba-compiled dynamics: CSR graphs (line, ring, uniform labeled tree, Erdős-Rényi G(n, p), bipartite G(n1, n2, p)), pluggable guards, four schedulers (shuffled, ordered, Bernoulli, independent) and five colorers (lowest, next or uniform free color, plus two blind variants that may leave clashes behind).
  • Monte-Carlo driver aggregating mean, variance and third central moment of both the number of steps and the number of activations before stabilization, on a fixed graph or on a fresh random graph per replica.
  • Experiment high-level API with cartesian-product sweeps, campaign addition, light matplotlib plotting, CSV export, and fits of the results (weighted least squares, test for a hidden term, recovery of exact fractions).
  • Exact stabilization time of the conflict-guard rule under the random central daemon, from three independent sources: the peak oracle, which samples it without running the dynamics (tinto.oracle), exact enumeration on small graphs (tinto.exact) and closed forms (tinto.theory).
  • Companion notebooks that check the numerical statements of the papers.
  • 100% branch-covered by doctest-based examples.

Quickstart

Install Tinto:

$ pip install tinto

Low-level API

Drive one trajectory on a line graph:

>>> from tinto import graphs, configs, schedulers, solvers, runners
>>> from tinto.io import set_seed
>>> set_seed(0)
>>> Config = configs.make()
>>> c = Config(graphs.line(20))
>>> sched = schedulers.shuffled()(c)
>>> solver = solvers.make()
>>> steps, activations = runners.simple(c, sched, solver)
>>> steps > 0
True
>>> c.total
0

Or Monte-Carlo the moments of both metrics over many replicas:

>>> from tinto import starters
>>> set_seed(0)
>>> starter = starters.from_graph(Config)(graphs.line(20))
>>> res = runners.mc(starter, schedulers.shuffled(), solver, n_trials=20)
>>> mean, var, m3 = res["steps"]
>>> mean > 0
True

High-level API

The Experiment class bundles a sweep + the Monte-Carlo runner + plot and export helpers. Define an Iterator over one parameter, wrap it in an Experiment, run:

>>> from tinto import Experiment, Iterator
>>> def build_starter(n):
...     return starters.from_graph(Config)(graphs.line(n))
>>> n_iter = Iterator("starter", [10, 20, 50], name="n", process=build_starter)
>>> exp = Experiment(
...     "line-sweep",
...     iterator=n_iter,
...     scheduler=schedulers.shuffled(),
...     solver=solver,
...     n_trials=50,
... )
>>> _ = exp.run(progress=False)
>>> exp.results["line-sweep"]["axes"]
('starter',)

Compose cartesian products with * and combine multiple campaigns with +:

>>> kind_iter = Iterator("starter", ["random", "mono"], name="kind")
>>> # plot or export via exp.plot(x="n", hue="kind") / exp.to_csv(...)

Credits

This package was created with Cookiecutter and the Package Helper 3 project template.

Metadata

Release files for tinto 0.1.0

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

Source distribution (sdist)

Source distribution for tinto 0.1.0
File Size Uploaded Provenance Actions
tinto-0.1.0.tar.gz 203.4 kB Without provenance Details for tinto-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 275.1 kB

Release files / tinto-0.1.0.tar.gz

Download URL tinto-0.1.0.tar.gz
Size 203.4 kB
Tags Source
SHA-256 checksum
How to use checksums
e4164c3ceff58eb367b60db845d32b20b9a8a15f220e7e75b44f7a2f007c0ff5
BLAKE2b-256 checksum
How to use checksums
053b2fffbfeeb43c73c219b2de8d0718dc5d14e5dbdd0dbe59a4cb22d18de301
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / tinto-0.1.0-py3-none-any.whl

Download URL tinto-0.1.0-py3-none-any.whl
Size 71.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b71b270ddf5d834fef428780316dfc1cb510b49a2dec37cbc69bf0aae31fbd85
BLAKE2b-256 checksum
How to use checksums
6752b9bc48e8907100e08eed0a693ff52dd58c6129629ea0f2282a4189b19e0b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for tinto 0.1.0

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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