Skip to main content

Loman tracks state of computations, and the dependencies between them, allowing full and partial recalculations.

Project description

Loman

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

License: MIT Python versions PyPI - Version PyPI - Wheel ReadTheDocs

Github Linux MAC OS Code style: ruff uv Hatch project CodeFactor

CI MARIMO DEVCONTAINER

Open in GitHub Codespaces

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.

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! โญ

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

loman-0.6.0.tar.gz (377.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

loman-0.6.0-py3-none-any.whl (48.7 kB view details)

Uploaded Python 3

File details

Details for the file loman-0.6.0.tar.gz.

File metadata

  • Download URL: loman-0.6.0.tar.gz
  • Upload date:
  • Size: 377.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for loman-0.6.0.tar.gz
Algorithm Hash digest
SHA256 835bb4a3cbc7661b377b813d2186ca5a74228162cb6aabaf42cfd78e18fae6cc
MD5 3868658a30aa6d75431263cd0d279363
BLAKE2b-256 89182e2d4f5d070afbd9549257c34aebd053119c7655740f6489a101463e21bd

See more details on using hashes here.

Provenance

The following attestation bundles were made for loman-0.6.0.tar.gz:

Publisher: rhiza_release.yml on janushendersonassetallocation/loman

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file loman-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: loman-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 48.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for loman-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3646c76bceeccaa1fe6149e18f13c5066f2be17b62d94790bfccdd37e2f89604
MD5 768ebb7450fdbdc7382bef50143de73c
BLAKE2b-256 3c3f92794fa1ca67cc714e32b3931916f349ad512ba1927846d6ba74d0892b6e

See more details on using hashes here.

Provenance

The following attestation bundles were made for loman-0.6.0-py3-none-any.whl:

Publisher: rhiza_release.yml on janushendersonassetallocation/loman

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page