Collection of tools to arrange bound methods into a graph.
Project description
Arcbound
Collection of tools to arrange bound methods into a graph.
Arcbound contains a series of decorators to aid data-driven programming, where the methods and properties of a class are abstracted as nodes on a graph, inter-connected by arcs (directed edges).
Installation
Usage example
import arcbound as ab
@ab.graph
class Example():
def __init__(self, root_val: int) -> None:
self.root = root_val
return None
@property
@ab.arc(x="root")
def branch(self, x: int) -> int:
return x * x
@ab.arc(x="branch", y="branch")
def leaf(self, x: int, y: int) -> int:
return x * y
@ab.arc(x="branch", y="leaf")
def catepillar(self, x: int, y: int) -> int:
return x * y
def twig(self, x: int, y: int) -> int:
return x * y
example = Example(5)
example.get_arcbound_node("catepillar")(y=-2)
# -50
example.visualize_arcbound_graph()
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
arcbound-0.0.3.tar.gz
(5.9 kB
view hashes)
Built Distribution
arcbound-0.0.3-py3-none-any.whl
(19.5 kB
view hashes)