Skip to main content

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()

arcbound_graph

Project details


Release history Release notifications

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for arcbound, version 0.0.3
Filename, size File type Python version Upload date Hashes
Filename, size arcbound-0.0.3-py3-none-any.whl (19.5 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size arcbound-0.0.3.tar.gz (5.9 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page