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 setting
config.DEBUG_SAVE_COMPUTATION_TRACE = True
or environment variable CG_DEBUG_SAVE_COMPUTATION_TRACE to true/t/1.
This will save a file, on each graph execution, named computation.dot
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
Built Distribution
File details
Details for the file computation-graph-1.tar.gz
.
File metadata
- Download URL: computation-graph-1.tar.gz
- Upload date:
- Size: 12.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | be8393a74886ee1da2a463d11ce5a0fa54514e9beef56e4090a5e9fc82652a33 |
|
MD5 | 619448076fc8822f1bfc0ae15f3deedf |
|
BLAKE2b-256 | c2c1589f10152c88d983e05791188edbe1f9569270f3f6b5b8c76ebb78447982 |
File details
Details for the file computation_graph-1-py3-none-any.whl
.
File metadata
- Download URL: computation_graph-1-py3-none-any.whl
- Upload date:
- Size: 52.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b92048afb665916d7ffb50957545ae8af87d7720aa858af702053a0225f70def |
|
MD5 | 3402401af69ea04a93b8cc3e83f6bc07 |
|
BLAKE2b-256 | 35be4219b5db87a646c2a8c37be75511be84aae81965cb498bca832a310f0785 |