No project description provided
Project description
A functional composition framework that supports:
- State - functions which retain state for their next turn of action.
- Ambiguity - non deterministic composition with priorities.
- Injection of compositions into long pipelines (deep dependency injection).
- Non cancerous
asyncio
support.
pip install computation-graph
To deploy: python setup.py sdist bdist_wheel; twine upload dist/*; rm -rf dist/;
Debugging
We need graphviz to visualize computation graphs:
sudo apt update && apt install graphviz
pip install pygraphviz
Debugging is possible by replacing to_callable
with run.to_callable_with_side_effect
with debug.serialize_computation_trace(filename)
as the first argument.
This 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-10.tar.gz
.
File metadata
- Download URL: computation-graph-10.tar.gz
- Upload date:
- Size: 13.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b387ebaa7d6fe355ab47834db520159df7b3bb2316dfec47bd9614d02d89fc3 |
|
MD5 | dad5ff91c4afc2138ee2a11f90db9f07 |
|
BLAKE2b-256 | 65cf3f404234a195b9d7c950ef2fac10977e84e084cb518895f074fa9ae550a4 |