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:
- Code passes
rufflinting:ruff check src/ - Code passes
mypytype checking:mypy src/ - Tests pass:
pytest tests/ - 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5537041a59fa4715add7a8227508a4f9a342be53fa39a1308dce76a11da34b93
|
|
| MD5 |
96de8f3c2a4a832cfeedb43f4cb34811
|
|
| BLAKE2b-256 |
7dc6b65506b62552dbb8d9b70bebd85e3b972109ced81e39ee29a2759b84cc3d
|
File details
Details for the file pyomo_solver_analyzer-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pyomo_solver_analyzer-0.1.0-py3-none-any.whl
- Upload date:
- Size: 16.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
569588be4993ffb5b6168a917691e557e610adae050ef6e54ffc368336390e70
|
|
| MD5 |
4353449ab6d93f92e33109fb0da3ee78
|
|
| BLAKE2b-256 |
2f7daab1e04e34c8c07d199c59bda0e9a01f6f6cbf3d6e8ca6d95064cfb984ec
|