Skip to content

PR 6/7: Benchmarking infrastructure for scipy vs Pyomo#11

Open
bernalde wants to merge 1 commit intopr/pyomo-optimizersfrom
pr/benchmarks
Open

PR 6/7: Benchmarking infrastructure for scipy vs Pyomo#11
bernalde wants to merge 1 commit intopr/pyomo-optimizersfrom
pr/benchmarks

Conversation

@bernalde
Copy link
Member

@bernalde bernalde commented Mar 3, 2026

Summary

Systematic comparison framework for scipy vs Pyomo optimizers. CLI tool (grid_cli.py) generates parameter sweeps across product resistance, heat transfer coefficients, and operating conditions. Compares objective values, solve times, and constraint satisfaction. Includes Jupyter notebook for visualization and analysis.

PR 6 of 7 in the Pyomo integration series.

Changes

  • benchmarks/adapters.py — Scipy/Pyomo adapter layer
  • benchmarks/grid_cli.py — CLI for running benchmark grids
  • benchmarks/scenarios.py — Predefined test scenarios
  • benchmarks/schema.py — Result schema definition
  • benchmarks/validate.py — Result validation
  • benchmarks/grid_analysis.ipynb — Analysis notebook
  • benchmarks/README.md — Benchmark documentation
  • benchmarks/results/ — Reference results and .gitignore

Usage

# Run default benchmark
python benchmarks/grid_cli.py

# Run specific scenario
python benchmarks/grid_cli.py --scenario sucrose_5pct

PR Chain

# PR Status
0 Sync upstream (#5) Merged
1 CI/CD for Pyomo (#6) Open
2 Pyomo dependencies (#7) Open
3 Utils & single-step (#8) Open
4 Multi-period model (#9) Open
5 Optimizer functions (#10) Open
6 Benchmarks (this PR)
7 Docs & examples Pending

Testing

No new pytest tests — benchmarks are standalone scripts. Results directory is gitignored.

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

This PR adds the benchmarking infrastructure for comparing scipy and Pyomo solvers:

benchmarks/ directory contents:
- adapters.py: Adapter classes for scipy and Pyomo solvers
- grid_cli.py: CLI tool for running grid comparison benchmarks
- scenarios.py: Test scenario definitions (standard, high resistance, etc.)
- schema.py: Result data schema for consistent output
- validate.py: Validation utilities for comparing results
- grid_analysis.ipynb: Jupyter notebook for analyzing benchmark results
- README.md: Documentation for running benchmarks

benchmarks/results/:
- .gitignore: Ignore large result files
- README.md: Documentation for result files
- archive/: Historical benchmark results
- baseline_*.jsonl: Baseline comparison results

Usage:
  python -m benchmarks.grid_cli --scenario baseline_Tsh --grid 3x3
  python -m benchmarks.grid_cli --scenario baseline_Pch --grid 5x5 --solver pyomo

This enables systematic comparison of scipy and Pyomo optimizer performance
across different scenarios and parameter grids.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant