Library to create and execute computation graphs
Project description
Bodkin is a Python library to create, evaluate, and visualize computation graphs.
Usage / terminology
bodkin.Node
- an abstract base class for for a black box that updates its outputs based on its inputs
bodkin.Atom
- a Node that is a fundamental building block. An Atom provides a function to update its outputs from its inputs. An Atom is what we would conventionally refer to as a node in a graph.
bodkin.DAG
- a directed acyclic graph that encapsulates a set of Nodes and evaluates them in order of dependency. A DAG consists of Node objects, so it may contain Atoms and/or other embedded DAGs.
Any Node's inputs and outputs may be accessed through its properties i
and o
, resepectively. These properties behave like dictionaries but can be linked together so that setting a output on one Node also sets an input on some other Node.
To learn more see the examples/basic.py
script for a basic usage example or pass an object into help()
. Feel free to open an issue for further questions.
Installation
Dependencies
Basic functionality only relies on the standard library, but visualizing objects via their show
method requires the dot
command from graphviz
.
From PyPI
Install using pip
python3 -m pip install bodkin
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file bodkin-0.1.1.tar.gz
.
File metadata
- Download URL: bodkin-0.1.1.tar.gz
- Upload date:
- Size: 10.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 82f540e745f01b1fb81d54ee0bfa5c55e01dcbafd9451ed845766f55ba2dd113 |
|
MD5 | 4333a7c6936ca8a2e3358e803d4c04ba |
|
BLAKE2b-256 | 6d65c815bdc3b37ca730f223c7d1e36add1ee498d11f8261847befb3924ae36f |
File details
Details for the file bodkin-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: bodkin-0.1.1-py3-none-any.whl
- Upload date:
- Size: 10.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e461a8f3e06cfeb24632cbf283cee63b7691bd8ffcf8b5899547c4ab395b6730 |
|
MD5 | d322a9db417526abfe99445c6f6e48ca |
|
BLAKE2b-256 | 13ec68c0a8d46423f713cf395adf0d2b723bea337afc484961423eeccdefe354 |