PR 2/7: Pyomo optional dependencies and module structure#7
Open
bernalde wants to merge 1 commit intopr/ci-cd-pyomofrom
Open
PR 2/7: Pyomo optional dependencies and module structure#7bernalde wants to merge 1 commit intopr/ci-cd-pyomofrom
bernalde wants to merge 1 commit intopr/ci-cd-pyomofrom
Conversation
This was referenced Mar 3, 2026
d4a1ce1 to
6fa03b3
Compare
58d26cd to
72e8b86
Compare
This PR adds the foundation for Pyomo integration: pyproject.toml changes: - Add [optimization] extra with pyomo>=6.7.0 and idaes-pse>=2.9.0 - These are optional dependencies, scipy-based code works without them Module structure: - lyopronto/pyomo_models/__init__.py: Placeholder with documentation - tests/test_pyomo_models/__init__.py: Test directory placeholder Installation: pip install .[optimization] # For Pyomo support pip install . # Standard scipy-only installation This enables users to opt-in to Pyomo optimization without affecting existing scipy-based workflows.
72e8b86 to
9b54119
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds Pyomo as an optional dependency (
pip install lyopronto[optimization]). Creates thelyopronto.pyomo_modelspackage with aPYOMO_AVAILABLEflag and graceful import handling. Pyomo coexists with scipy — both remain available.PR 2 of 7 in the Pyomo integration series.
Changes
lyopronto/pyomo_models/__init__.py— Module init with lazy imports, availability checkpyproject.toml— Add[project.optional-dependencies]foroptimizationextra (pyomo, idaes-pse)tests/test_pyomo_models/__init__.py— Test package initKey Design Decision
Coexistence, not replacement. Installing the
optimizationextra adds Pyomo alongside scipy. The core package works without Pyomo. Code checksPYOMO_AVAILABLEbefore using Pyomo features.PR Chain
Testing
No new tests added. Import test validates graceful fallback when Pyomo is not installed.