Loman
raw JSON → 0.6.0 verified Mon Apr 27 auth: no python
Loman tracks the state of computations and the dependencies between them, enabling full and partial recalculations. It provides a directed acyclic graph (DAG) of computations with caching, error handling, and serialization support. Current version is 0.6.0, released in April 2026. Release cadence is approximately monthly.
pip install loman Common errors
error ModuleNotFoundError: No module named 'dill' ↓
cause dill was removed as a dependency in loman 0.6.0.
fix
Upgrade to loman 0.6.0 or later, and ensure your code does not import dill. If you need dill, install it separately: pip install dill
error KeyError: 'node_name' ↓
cause Trying to get the value of a node that hasn't been computed yet or doesn't exist.
fix
Ensure the node is defined and computed: call comp.compute_all() or compute the specific node before calling get_value('node_name').
Warnings
breaking In version 0.6.0, the dill dependency was removed, and serialization now uses Python's built-in pickle. Custom serialization logic may break if it relied on dill. ↓
fix Replace any usage of dill-specific serialization with standard pickle or check your serialization hooks.
gotcha Node functions must not have side effects on mutable global state, or caching may produce unexpected results. Loman caches results by default, so if a node modifies an external list, partial recomputations will not re-trigger that side effect. ↓
fix Ensure node functions are pure (no side effects) or use the 'always_recompute' parameter.
deprecated The 'compute_and_get_value' method is deprecated as of version 0.5.4. It may be removed in a future release. ↓
fix Use 'compute_all' then 'get_value' instead.
Imports
- Computation
from loman import Computation - ComputationNode
from loman import ComputationNode
Quickstart
from loman import Computation
# Create a computation graph
comp = Computation()
# Define nodes (computations)
@comp.node('a')
def compute_a():
return 1
@comp.node('b', depends_on=['a'])
def compute_b(a):
return a + 2
# Run the computation
comp.compute_all()
print(comp.get_value('b')) # Output: 3