Skip to content

Support using Expressions in numpy matrix operations#3636

Merged
blnicho merged 3 commits intoPyomo:mainfrom
jsiirola:numpy-expr
Jun 28, 2025
Merged

Support using Expressions in numpy matrix operations#3636
blnicho merged 3 commits intoPyomo:mainfrom
jsiirola:numpy-expr

Conversation

@jsiirola
Copy link
Copy Markdown
Member

Fixes # .

Summary/Motivation:

#2027 and #2070 added support for using variables and parameters in numpy matrix operations. Unfortunately, it failed to include Expression objects (which was recently pointed out by @eslickj). This PR resolves that oversight (including a simple test of the functionality).

Changes proposed in this PR:

  • Support conversion of Expression objects into numpy.ndarray(dtype=object) objects

Legal Acknowledgement

By contributing to this software project, I have read the contribution guide and agree to the following terms and conditions for my contribution:

  1. I agree my contributions are submitted under the BSD license.
  2. I represent I am authorized to make the contributions and grant the license. If my employer has rights to intellectual property that includes these contributions, I represent that I have received permission to make contributions and grant the required license on behalf of that employer.

@blnicho blnicho moved this from Todo to Reviewer Approved in August 2025 Release Jun 23, 2025
@blnicho blnicho merged commit f48c551 into Pyomo:main Jun 28, 2025
64 of 65 checks passed
@github-project-automation github-project-automation bot moved this from Reviewer Approved to Done in August 2025 Release Jun 28, 2025
@jsiirola jsiirola deleted the numpy-expr branch August 1, 2025 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects

Development

Successfully merging this pull request may close these issues.

2 participants