TurboGraph: Lightweight Dependency-Driven Computation#
TurboGraph is a simple Python library, for defining and computing values based on dependencies. It is based on the lightweight igraph package. It automatically builds a dependency graph from function argument names or explicit specifications, ensuring computations run in the correct order.
Hereβs a simple example showing how TurboGraph automatically infers dependencies:
from turbograph import compute
specifications = {
"a": 2,
"sum": lambda a, b: a + b, # Depends on "a" and "b"
}
result = compute(specifications, ["sum"], {"b": 3})
print(result) # {"sum": 5}
TurboGraph analyzes the function signatures and determines that "sum"
depends on "a"
and "b"
,
executing the computations in the correct order.
Contents:
- Installation
- Quick Start Guide
- π Why Use TurboGraph?
- β Setting Up: Logging & Debugging
- β Understanding the Computation Graph (DAG)
- β Running Computations with compute()
- β Defining Computations (Vertex Specifications)
- β Controlling Function Execution with
call_mode
- β Reusing Graphs
- β Modifying Graphs
- β¨ Takeaways
- Development
- Changelog
- Credits