metricengine.registry
Registry for financial calculations with dependency tracking.
- metricengine.registry.calc(name, *, depends_on=())[source]
Decorator to register a calculation function with its dependencies.
- metricengine.registry.list_calculations()[source]
List all registered calculations and their dependencies (copies).
- metricengine.registry.clear_registry()[source]
Clear all registered calculations. Primarily for testing.
- Return type:
- metricengine.registry.is_registered(name)[source]
Check if a calculation is registered.
- Return type:
- metricengine.registry.unregister(name)[source]
Remove a calculation from the registry (and its edges).
- Return type:
- metricengine.registry.dependency_graph()[source]
Get a read-only view of the dependency graph (copies of sets).
- metricengine.registry.detect_cycles()[source]
Return a set of cycles detected in the dependency graph (as tuples). Simple DFS; fine for small graphs.