Skip to content

Complete numpy integration with components and expressions#2070

Merged
mrmundt merged 32 commits intoPyomo:mainfrom
jsiirola:numpy-part3
Aug 12, 2021
Merged

Complete numpy integration with components and expressions#2070
mrmundt merged 32 commits intoPyomo:mainfrom
jsiirola:numpy-part3

Conversation

@jsiirola
Copy link
Copy Markdown
Member

@jsiirola jsiirola commented Aug 5, 2021

Fixes #68, fixes #87, fixes #611, fixes #2030, fixes #2033

Summary/Motivation:

This PR completes the initial development sequence to improve NumPy support in Pyomo model generation.

Changes proposed in this PR:

  • Improve the Initializer() handling of numpy and pandas data types
  • Allow Initializer to recognize "constant" rule functions
  • Add standardized methods for processing kwargs with multiple aliases (e.g., within and domain)
  • Make all Pyomo NumericValues compatible with NumPy ufuncs
  • Move numpy type registration from pyomo.core.kernel and into pyomo.common.dependencies
  • Update Param, Expression, and Objective to leverage Initializer() and standardized method for constructing components from a rule

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.

@codecov
Copy link
Copy Markdown

codecov bot commented Aug 6, 2021

Codecov Report

Merging #2070 (218dafe) into main (b446985) will increase coverage by 0.00%.
The diff coverage is 93.92%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2070   +/-   ##
=======================================
  Coverage   82.98%   82.98%           
=======================================
  Files         610      611    +1     
  Lines       76116    76095   -21     
=======================================
- Hits        63162    63150   -12     
+ Misses      12954    12945    -9     
Impacted Files Coverage Δ
pyomo/core/kernel/__init__.py 100.00% <ø> (ø)
pyomo/core/base/param.py 80.05% <82.97%> (-0.92%) ⬇️
pyomo/core/base/indexed_component.py 89.79% <91.42%> (+0.14%) ⬆️
pyomo/core/base/initializer.py 98.12% <95.65%> (-0.50%) ⬇️
pyomo/common/dependencies.py 98.80% <100.00%> (+0.05%) ⬆️
pyomo/common/numeric_types.py 100.00% <100.00%> (ø)
pyomo/core/base/constraint.py 92.40% <100.00%> (+0.03%) ⬆️
pyomo/core/base/expression.py 91.16% <100.00%> (+1.64%) ⬆️
pyomo/core/base/range.py 99.81% <100.00%> (-0.19%) ⬇️
pyomo/core/base/set.py 99.66% <100.00%> (+<0.01%) ⬆️
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b446985...218dafe. Read the comment docs.

@jsiirola jsiirola requested a review from mrmundt August 12, 2021 05:40
@mrmundt mrmundt merged commit f2a9fa7 into Pyomo:main Aug 12, 2021
@jsiirola jsiirola deleted the numpy-part3 branch August 12, 2021 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants