Development Guide

This guide is for contributors and advanced users who want to understand LumiX’s architecture and extend its functionality.

Development Topics

Overview

LumiX is built with several key principles:

  1. Type Safety: Extensive use of Python’s type system

  2. Data-Driven: Models built from data, not loops

  3. Solver Agnostic: Unified interface to multiple solvers

  4. Fluent API: Method chaining for readability

  5. Automatic Expansion: Variable/constraint families expand during solving

Target Audience

This guide is for:

  • Contributors to LumiX

  • Advanced users building extensions

  • Researchers customizing the library

  • Anyone curious about the internals

Getting Started

Clone and Install

git clone https://github.com/tdelphi1981/LumiX.git
cd LumiX
pip install -e .[dev]

Run Tests

pytest

Type Check

mypy src/lumix

Code Style

black src/lumix
ruff check src/lumix

Module Overview

        graph TD
    A[core] --> B[solvers]
    A --> C[analysis]
    A --> D[linearization]
    A --> E[goal_programming]
    F[indexing] --> A
    G[nonlinear] --> D
    H[solution] --> B
    I[utils] --> A

    style A fill:#e1f5ff
    style B fill:#fff4e1
    style C fill:#ffe1e1
    style D fill:#e1ffe1
    style E fill:#f0e1ff
    

Core Modules:

  • core: Model building (variables, constraints, expressions, models) (documented)

  • solvers: Solver interfaces (OR-Tools, Gurobi, CPLEX, GLPK, CP-SAT) (documented)

  • indexing: Multi-dimensional indexing utilities (documented)

  • nonlinear: Non-linear term definitions (documented)

  • linearization: Automatic linearization engine (documented)

  • utils: Logging, ORM, rational conversion (documented)

  • solution: Solution handling and mapping (documented)

  • analysis: Sensitivity, scenario, what-if analysis (documented)

  • goal_programming: Multi-objective optimization

Core Module Documentation

Deep dive into the core module’s architecture and extensibility:

Solvers Module Documentation

Understand solvers architecture and how to add new solver implementations:

Indexing Module Documentation

Understand indexing architecture and customization:

Nonlinear Module Documentation

Learn about nonlinear term definitions and how to extend them:

Utils Module Documentation

Learn about utils module architecture and how to extend it:

Linearization Module Documentation

Understand linearization architecture and customization:

Solution Module Documentation

Learn about solution handling architecture and customization:

Analysis Module Documentation

Learn about analysis tools architecture and customization:

Goal Programming Module Documentation

Learn about goal programming architecture and customization:

Next Steps

For Core Module Development:

For Solvers Module Development:

For Indexing Module Development:

For Nonlinear Module Development:

For Utils Module Development:

For Linearization Module Development:

For Solution Module Development:

For Analysis Module Development:

For Goal Programming Module Development: