Skip to main content

Build and visualize orbit graphs for discrete iterations under guarded rules.

Project description

VisIter

See what a discrete iteration actually does — as a graph.

The simplest case

Integers 1–9. Rule: divisible by 3 → divide by 3. Everything else → add 2. Where does each value end up?

echo 'range(1, 10), [Rule(lambda x: x%3==0, Op(lambda x: x//3))], Op(lambda x: x+2)' | viter

descent graph, range 1–9

One line, auto-derived edge labels, SVG on stdout.

Install

pip install visiter

Graphviz must be available on PATH (brew install graphviz / apt install graphviz).

Going further

Put the iteration in a .vit file — shebang-executable, with comments:

#!/usr/bin/env viter
# descent graph, range 1–9
range(1, 10),
[Rule(lambda x: x%3==0, Op(lambda x: x//3, label="÷3"))],
Op(lambda x: x+2, label="+2")
chmod +x descent.vit
./descent.vit > descent.svg       # shebang
viter descent.vit -o descent.svg  # explicit

Crop the view around a node, render only what reaches it:

viter descent.vit --render 'anchor=1, radius=8, direction="backward"' -o crop.svg

Use the Python API instead of the CLI:

from visiter import iterate, Op, Rule, to_dot

graph = iterate(
    range(1, 10),
    [Rule(lambda x: x % 3 == 0, Op(lambda x: x // 3))],
    Op(lambda x: x + 2),
)
to_dot(graph).render("descent", format="svg")

Two entry points

  • viter — one-shot: .vit file (or stdin) in, image out. Safe defaults (--max-nodes 10000, --time-limit 00:00:30) keep a typo'd rule from running away. Output goes to stdout or -o FILE.

  • visiter — pipe-composable subcommands for full control:

    visiter build descent.vit | visiter to-dot 'anchor=1' | dot -Tsvg > out.svg
    

    build writes JSON; to-dot reads JSON, writes DOT; validate checks the JSON against the bundled schema; analyze bridges to NetworkX for graph algorithms.

Why VisIter?

Free, scriptable, Graphviz-native, Unix-pipe-composable orbit-graph rendering for discrete iterations under guarded rules — with cutoff boundaries (bounds, depth limits, render crops) as a first-class visual primitive, not silent truncation.

Full honest comparison against NetworkX, NestGraph (Mathematica), Maude, LoLA, and continuous-dynamics tooling: docs/comparison.md.

Documentation

  • docs/tutorial.md — gentle introduction: what problem the tool solves, smallest example, what each piece does, what the dashed arrows mean. Start here.
  • docs/manual.md — reference: every parameter, every data field, the rendering model in full, design decisions.
  • docs/comparison.md — how VisIter relates to other tools in the ecosystem, and when to pick something else.
  • demos/ — runnable end-to-end examples: make demo writes SVG/PDF/DOT into demos/out/.

License

MIT

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

visiter-0.8.1.tar.gz (191.8 kB view details)

Uploaded Source

Built Distribution

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

visiter-0.8.1-py3-none-any.whl (29.0 kB view details)

Uploaded Python 3

File details

Details for the file visiter-0.8.1.tar.gz.

File metadata

  • Download URL: visiter-0.8.1.tar.gz
  • Upload date:
  • Size: 191.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for visiter-0.8.1.tar.gz
Algorithm Hash digest
SHA256 d4d9ca5b3423c39c282fe66ec9e64d1b227cdfef4f7bb2ed28e63df701997f7d
MD5 0255683886e2fc424013c0852c28ddd9
BLAKE2b-256 7c5245934caa73715b2961bdf24d1452f206363a20d0630b45244ef5e2f63000

See more details on using hashes here.

File details

Details for the file visiter-0.8.1-py3-none-any.whl.

File metadata

  • Download URL: visiter-0.8.1-py3-none-any.whl
  • Upload date:
  • Size: 29.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for visiter-0.8.1-py3-none-any.whl
Algorithm Hash digest
SHA256 65b1f3c6715043d51a7cd19068f9b74814c7b4bead605bb7dd301f5a88107b62
MD5 15535ada49ef8770ab131179c5d7b78f
BLAKE2b-256 007fb8eef146b0a36faec44dd453700d331a51f197db94768b2f4820e6989916

See more details on using hashes here.

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