Smart computation management - Only recalculate what's necessary
Loman tracks the state of your computations and their dependencies, enabling intelligent partial recalculations that save time and computational resources. Perfect for data pipelines, real-time systems, and complex analytical workflows.
- β¨ Features
- π₯ Installation
- π οΈ Development
- π Quick Start
- π Documentation
- βοΈ Codespaces
- π₯ Contributing
Build smarter computation graphs with automatic dependency tracking
- π Smart Recalculation: Only compute what's changed - save time and resources
- π Dependency Tracking: Automatic graph-based dependency management
- π― Selective Updates: Control which outputs to compute and when
- πΎ State Persistence: Serialize computation graphs for inspection and recovery
- π Visual Debugging: Built-in GraphViz integration for computation visualization
- β‘ Real-time Ready: Perfect for systems with inputs that tick at different rates
- π§ͺ Research Friendly: Iterate quickly by updating methods and re-running only necessary computations
- π Framework Agnostic: Works with NumPy, Pandas, and your favorite Python libraries
The above computation graph was generated with this simple Loman code:
from loman import Computation
# Create a computation graph
comp = Computation()
comp.add_node('a', value=1) # Input node
comp.add_node('b', lambda a: a + 1) # b depends on a
comp.add_node('c', lambda a, b: 2 * a) # c depends on a and b
comp.add_node('d', lambda b, c: b + c) # d depends on b and c
comp.add_node('e', lambda c: c + 1) # e depends on c
# Smart computation - only calculates what's needed
comp.compute('d') # Will not compute 'e' unnecessarily!
# Inspect intermediate values
comp.to_dict()
# {'a': 1, 'b': 2, 'c': 2, 'd': 4, 'e': None}
# Visualize the computation graph
comp.draw() # Creates the graph shown above
π Explore More: Check out our Interactive Examples including:
- π° Interest Rate Swap Pricing
- π Portfolio Valuation
- π¦ CDO Modeling
Loman transforms how you build and maintain complex data processing pipelines by making computational dependencies explicit and manageable. Instead of manually tracking what needs to be recalculated when data changes, Loman handles this automatically.
-
π΄ Real-time Systems: Handle inputs that tick at different rates efficiently
- Only recalculate affected downstream computations
- Control which outputs are computed and when
- Monitor status of all components in your pipeline
-
π¦ Batch Processing: Build robust daily/periodic processes
- Serialize computation state for easy inspection and debugging
- Replace inputs or override intermediate values without full recomputation
- Recover from failures efficiently by resuming from last good state
-
π¬ Research & Analytics: Accelerate iterative development
- Modify calculation methods and re-run only what's needed
- Track complex dependencies in evolving analysis pipelines
- Reuse expensive intermediate computations across experiments
π Learn More: The Introduction explains in detail how Loman can transform your workflow.
pip install lomangit clone https://github.com/janusassetallocation/loman.git
cd loman
pip install -e .Note: Use -e flag for editable installation during development
For contributors and advanced users
Loman uses modern Python development tools for a smooth developer experience:
# π¦ Install development dependencies
make install
# π§ͺ Run tests with coverage
make test
# β¨ Format and lint code
make check- Testing: pytest with coverage reporting
- Formatting: ruff for code formatting and linting
- Task Management: Taskfile for build automation
- Quality: Pre-commit hooks for code quality
- π Complete Documentation: Comprehensive guides and API reference
- π Quickstart Guide: Get up and running in minutes
- π‘ User Guide: In-depth concepts and strategies
- π Interactive Examples: Real-world financial modeling examples
- π§ API Reference: Complete function and class documentation
Instant development environment in your browser Click the button to launch a fully configured development environment in your browser.
- π Python 3.13 - Latest Python with all dependencies pre-installed
- π οΈ Development Tools - pytest, ruff, mypy, pre-commit hooks ready to go
- π Interactive Notebooks - Marimo notebooks for exploring examples
- β‘ Zero Setup - Everything configured ready to go
- π― VS Code Extensions - Python, testing, and productivity extensions pre-installed
We welcome contributions! π
Whether you're fixing bugs, adding features, or improving documentation, your help makes Loman better for everyone.
- π΄ Fork the repository
- πΏ Create your feature branch:
git checkout -b feature/amazing-feature - β¨ Make your changes and add tests
- π§ͺ Test your changes:
make test - π Commit your changes:
git commit -m 'Add amazing feature' - π Push to your branch:
git push origin feature/amazing-feature - π― Open a Pull Request
- π Contributing Guide
- π€ Code of Conduct
- π Issue Tracker
- Jebel-Quant/rhiza for standardised CI/CD templates and project tooling
β If you find Loman useful, please consider giving it a star! β
