Skip to content

tschm/loman

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Loman

Manage complex calculation flow via robust DAG-based dependency logic in Python

Smart computation management - Only recalculate what's necessary

Python Version PyPI - Version PyPI - Wheel Github - Test Status ReadTheDocs Codespaces

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.

Table of Contents

✨ Features

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

πŸš€ Quick Start

Loman Graph Example

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

Why Loman?

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.

Perfect for:

  • πŸ”΄ 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.

πŸ“₯ Installation

Using pip (recommended)

pip install loman

From source (development)

git clone https://github.com/janusassetallocation/loman.git
cd loman
pip install -e .

Note: Use -e flag for editable installation during development

πŸ› οΈ 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

Development Tools

  • 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

πŸ“– Documentation

☁️ Try Loman in Codespaces

Open in GitHub Codespaces

Instant development environment in your browser Click the button to launch a fully configured development environment in your browser.

What's Included

  • 🐍 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

πŸ‘₯ Contributing

We welcome contributions! πŸŽ‰

Whether you're fixing bugs, adding features, or improving documentation, your help makes Loman better for everyone.

Quick Start for Contributors

  1. 🍴 Fork the repository
  2. 🌿 Create your feature branch: git checkout -b feature/amazing-feature
  3. ✨ Make your changes and add tests
  4. πŸ§ͺ Test your changes: make test
  5. πŸ“ Commit your changes: git commit -m 'Add amazing feature'
  6. πŸš€ Push to your branch: git push origin feature/amazing-feature
  7. 🎯 Open a Pull Request

Resources

Acknowledgments πŸ™


⭐ If you find Loman useful, please consider giving it a star! ⭐

About

Control complex calculation flow for quantitative research and trading

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 88.9%
  • Shell 8.7%
  • Makefile 2.4%