Skip to main content

License PyPI version

twwanim

Twin-width animation tools. Given an (undirected, simple) graph and a corresponding contraction sequence (see Wikipedia for the definition of twin-width), twwanim creates a video visualizing contractions and red edges.

Example

Dependencies

Installation

  • Install LaTeX distribution (the following are recommended):
    • (Mac) MacTeX: brew install --cask mactex-no-gui
    • (Linux) TeX Live:
      • (Debian) sudo apt install texlive texlive-latex-extra
      • (Fedora) sudo dnf install texlive-scheme-full
    • (Windows) MikTeX
  • Install Manim Community: follow the installation docs.
  • Install twwanim: run pip install twwanim.
Operation Command
Install pip install twwanim
Upgrade pip install --upgrade twwanim
Uninstall pip uninstall twwanim
Check installed version twwanim --version
Help twwanim -h

Getting Started

  1. Make sure the command twwanim has been installed.
$ twwanim --version
twwanim 0.0.1
$ twwanim --help
(the usage will be shown)
  1. The command twwanim takes two inputs: a graph and a contraction sequence.
  • Graph file (.json or .gr):
    • An edge list in the JSON format (output of json.dumps(networkx.node_link_data(G))) or the PACE 2023 input format.
    • For the JSON format, you may include the position of each node as a node property pos.
    • See the Jupyter Notebook for an example of graph conversions.
  • Contraction sequence (.json or .txt):

Example:

twwanim -p -ql tests/resources/pace2023/public/exact_001.json tests/resources/pace2023/public/exact_001_cs.txt
  • -p: Preview the video after rendering it.
  • -ql: Set the quality to low (854x480 15FPS).
  • tests/resources/pace2023/tiny/tiny001.json: Path to a graph file.
  • tests/resources/pace2023/tiny/tiny001_cs.txt: Path to a contraction sequence file.
  1. A video will be made in the media/videos directory.

The example above will create media/videos/480p15/TwinwidthAnimation.mp4.

Gallery

The following videos are available on YouTube.

Developer's Guide

Operation Command
Run unit tests make test
Install in the developer mode make dev-install

Metadata

Release files for twwanim 0.0.2

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

Source distribution (sdist)

Source distribution for twwanim 0.0.2
File Size Uploaded Provenance
twwanim-0.0.2.tar.gz 14.6 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 29.8 kB

Release files / twwanim-0.0.2.tar.gz

Download URL twwanim-0.0.2.tar.gz
Size 14.6 kB
Tags Source
SHA-256 checksum
How to use checksums
aa5046231334a826e4f54d7400ba2165c16b42106a8d74896fbb847b28a4ca06
BLAKE2b-256 checksum
How to use checksums
06e8a5e184e71ebcbbfe1b4addb8e4c3d55c6b7cfba6a084980f10cfc702d451
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.4

Release files / twwanim-0.0.2-py3-none-any.whl

Download URL twwanim-0.0.2-py3-none-any.whl
Size 15.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
033051b4027a67cc167ef50905b831886a6bfdf277b7076c3596348e29a6e916
BLAKE2b-256 checksum
How to use checksums
cde54507c16063ce6c8f9510c38243fc5fad7676b3fcf5c50ba8a92c39c66051
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.4

Security for twwanim 0.0.2

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.0.2 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