No project description provided
Project description
A function composition framework that supports:
- State - functions which retain state for their next turn of action.
- Prioritized paths - lazily attempt overloaded composition paths according to priorities.
- Deep dependency injection - compose a function to a variadic function at the end of an arbitrarily long pipeline.
- Non cancerous
asyncio
support.
pip install computation-graph
To deploy: python setup.py sdist bdist_wheel; twine upload dist/*; rm -rf dist/;
Type checking
The runner will type check all outputs for nodes with return type annotations. In case of a wrong typing, it will log the node at fault.
Debugging
Computation trace
Available computation trace visualizers:
graphviz.computation_trace
mermaid.computation_trace
ascii.computation_trace
To use, replace to_callable
with run.to_callable_with_side_effect
with your selected style as the first argument.
Graphviz debugger
This debugger will save a file on each graph execution to current working directory.
You can use this file in a graph viewer like gephi. Nodes colored red are part of the 'winning' computation path. Each of these nodes has the attributes 'result' and 'state'. 'result' is the output of the node, and 'state' is the new state of the node.
In gephi you can filter for the nodes participating in calculation of final result by filtering on result != null.
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
File details
Details for the file computation-graph-35.tar.gz
.
File metadata
- Download URL: computation-graph-35.tar.gz
- Upload date:
- Size: 20.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | aae23afb1fa2b7c96478480a0351b87837fd8c352ff9cac34ec3c4bc74f1738e |
|
MD5 | c641bfe5df4f3cfbf3b19522fab3b83b |
|
BLAKE2b-256 | 24d74103aeabe7dab7640a693fe1b0d19df2dd248d1789d4ceae0eb6e206a210 |