Tinto
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.
- Free software: MIT
- Documentation: https://balouf.github.io/tinto/.
- Github: https://github.com/balouf/tinto
Features
- Numba-compiled dynamics: CSR graphs (line, ring, uniform labeled tree,
Erdős-Rényi
G(n, p), bipartiteG(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.
Experimenthigh-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.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tinto-0.1.1.tar.gz | 203.5 kB | Without provenance | Details for tinto-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tinto-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for tinto-0.1.1-py3-none-any.whl |
Total release size: 275.2 kB
Release files / tinto-0.1.1.tar.gz
| Download URL | tinto-0.1.1.tar.gz |
|---|---|
| Size | 203.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8a84184067af927a1c0b9136dd633400c24565a49f8b41e17a97af00d8aa0a21
|
|
BLAKE2b-256 checksum How to use checksums |
cf1884793fc04b2a7e3d5256da3553995842491e5645365cbed0f4aa110e2ddf
|
| 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.1-py3-none-any.whl
| Download URL | tinto-0.1.1-py3-none-any.whl |
|---|---|
| Size | 71.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d6d1c3258758f66d6563b5bc209a28c0aae9e83f113adc94acba944cc16349b8
|
|
BLAKE2b-256 checksum How to use checksums |
692d1a344839cb55be830b481d81e6f00865de3c9157925f87f15b0dec85aca7
|
| 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.1
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.