Skip to main content

Automatic constraint analysis and debugging for Pyomo linear solvers

Project description

PyomoDebugger

A constraint analysis and debugging toolkit for Pyomo, an open-source optimization modeling language in Python. This library provides tools for analyzing solver outputs, diagnosing infeasibility, and identifying binding constraints in linear optimization models.

Features

  • Constraint Analysis: Identify tight constraints, slack variables, and sensitivity metrics
  • Infeasibility Detection: Diagnose why models are infeasible
  • Solver Diagnostics: Analyze solver outputs and optimization results
  • Constraint Introspection: Deep inspection of constraint properties and relationships
  • Performance Analysis: Identify performance bottlenecks and limiting factors

Installation

Install from PyPI:

pip install pyomo-solver-analyzer

Or install from source with development dependencies:

git clone https://github.com/jaimerp94/PyomoDebugger.git
cd PyomoDebugger
pip install -e ".[dev]"

Quick Start

from pyomo_solver_analyzer import SolverDiagnostics
import pyomo.environ as pyo

# Create and solve your Pyomo model
model = pyo.ConcreteModel()
# ... define your model ...
solver = pyo.SolverFactory('glpk')
solver.solve(model)

# Analyze the results
diagnostics = SolverDiagnostics(model)
report = diagnostics.generate_diagnostics_report()
print(report)

Documentation

Development

For detailed development setup instructions, see DEVELOPMENT.md.

Project Structure

PyomoDebugger/
├── src/
│   └── pyomo_solver_analyzer/       # Main package
│       ├── __init__.py
│       ├── analyzer.py
│       ├── diagnostics.py
│       ├── introspection.py
│       └── unfeasibility.py
├── tests/                           # Test suite
├── docs/                            # Documentation
├── README.md
├── LICENSE
├── pyproject.toml                   # Project configuration
└── DEVELOPMENT.md

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for guidelines.

Before committing, ensure:

  1. Code passes ruff linting: ruff check src/
  2. Code passes mypy type checking: mypy src/
  3. Tests pass: pytest tests/
  4. Pre-commit hooks pass: pre-commit run --all-files

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

For issues, questions, or feature requests, please open an issue on GitHub.

Citation

If you use this library in your research, please cite:

@software{pyomo_solver_analyzer,
  title={Pyomo Solver Analyzer},
  author={Martin, Jaime},
  year={2024},
  url={https://github.com/jaimerp94/PyomoDebugger}
}

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

pyomo_solver_analyzer-0.1.0.tar.gz (105.2 kB view details)

Uploaded Source

Built Distribution

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

pyomo_solver_analyzer-0.1.0-py3-none-any.whl (16.1 kB view details)

Uploaded Python 3

File details

Details for the file pyomo_solver_analyzer-0.1.0.tar.gz.

File metadata

  • Download URL: pyomo_solver_analyzer-0.1.0.tar.gz
  • Upload date:
  • Size: 105.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for pyomo_solver_analyzer-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5537041a59fa4715add7a8227508a4f9a342be53fa39a1308dce76a11da34b93
MD5 96de8f3c2a4a832cfeedb43f4cb34811
BLAKE2b-256 7dc6b65506b62552dbb8d9b70bebd85e3b972109ced81e39ee29a2759b84cc3d

See more details on using hashes here.

File details

Details for the file pyomo_solver_analyzer-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pyomo_solver_analyzer-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 569588be4993ffb5b6168a917691e557e610adae050ef6e54ffc368336390e70
MD5 4353449ab6d93f92e33109fb0da3ee78
BLAKE2b-256 2f7daab1e04e34c8c07d199c59bda0e9a01f6f6cbf3d6e8ca6d95064cfb984ec

See more details on using hashes here.

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