Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for cyipopt #2830

Merged
merged 11 commits into from
May 30, 2023
Merged

add support for cyipopt #2830

merged 11 commits into from
May 30, 2023

Conversation

ZedongPeng
Copy link
Contributor

@ZedongPeng ZedongPeng commented May 15, 2023

Summary/Motivation:

Add the support for cyipopt as a NLP solver in MindtPy.

Related issue: #2831

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 requested a review from emma58 May 16, 2023 18:41
@emma58
Copy link
Contributor

emma58 commented May 16, 2023

@ZedongPeng, it looks like you need to run black on this. (It needs to pass that before the other tests will run.) The command is black -S -C pyomo/contrib/mindtpy.

@ZedongPeng
Copy link
Contributor Author

Hi @emma58 . Where to add the black -S -C pyomo/contrib/mindtpy command?

@emma58
Copy link
Contributor

emma58 commented May 19, 2023

@ZedongPeng, you want to run that command from the commandline on this branch, and then push the result. (You can install black with pip or conda, I think.)

@mrmundt
Copy link
Contributor

mrmundt commented May 22, 2023

@ZedongPeng, you want to run that command from the commandline on this branch, and then push the result. (You can install black with pip or conda, I think.)

@ZedongPeng - Correct. You can install black by running pip install black or conda install black; then you run the command: black -S -C pyomo/contrib/mindtpy; then add/commit/push the changes to this branch.

@ZedongPeng
Copy link
Contributor Author

The failing tests are not related to MindtPy. I think this PR is ready for a review. @emma58 @mrmundt

@codecov
Copy link

codecov bot commented May 26, 2023

Codecov Report

Patch coverage: 88.23% and project coverage change: +0.01 🎉

Comparison is base (2cb3210) 87.45% compared to head (bbc2b23) 87.47%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2830      +/-   ##
==========================================
+ Coverage   87.45%   87.47%   +0.01%     
==========================================
  Files         771      771              
  Lines       89579    89646      +67     
==========================================
+ Hits        78342    78416      +74     
+ Misses      11237    11230       -7     
Flag Coverage Δ
linux 84.53% <88.23%> (+<0.01%) ⬆️
osx 74.56% <11.76%> (-0.01%) ⬇️
other 84.71% <88.23%> (+0.01%) ⬆️
win 82.11% <88.23%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pyomo/contrib/mindtpy/MindtPy.py 100.00% <ø> (ø)
pyomo/contrib/mindtpy/config_options.py 100.00% <ø> (ø)
pyomo/contrib/mindtpy/feasibility_pump.py 100.00% <ø> (ø)
pyomo/contrib/mindtpy/outer_approximation.py 90.62% <ø> (ø)
pyomo/contrib/mindtpy/nlp_solve.py 65.08% <50.00%> (-0.19%) ⬇️
pyomo/contrib/mindtpy/single_tree.py 50.93% <50.00%> (-0.01%) ⬇️
pyomo/contrib/mindtpy/algorithm_base_class.py 81.19% <100.00%> (+0.40%) ⬆️
pyomo/contrib/mindtpy/extended_cutting_plane.py 84.61% <100.00%> (ø)
...yomo/contrib/mindtpy/global_outer_approximation.py 37.03% <100.00%> (ø)
pyomo/contrib/mindtpy/mip_solve.py 54.81% <100.00%> (ø)
... and 1 more

... and 3 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Contributor

@bernalde bernalde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good PR. I left some comments with small changes in the comments and class names. Maybe we can add more tests exercising the fact that we have an extra solver now (and, for example trying some non-supported solver name just in case).

pyomo/contrib/mindtpy/algorithm_base_class.py Show resolved Hide resolved
pyomo/contrib/mindtpy/algorithm_base_class.py Show resolved Hide resolved
pyomo/contrib/mindtpy/feasibility_pump.py Show resolved Hide resolved
pyomo/contrib/mindtpy/nlp_solve.py Show resolved Hide resolved
pyomo/contrib/mindtpy/outer_approximation.py Show resolved Hide resolved
pyomo/contrib/mindtpy/single_tree.py Show resolved Hide resolved
pyomo/contrib/mindtpy/util.py Show resolved Hide resolved
Copy link
Contributor

@emma58 emma58 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with @bernalde that adding some tests would be good--in particular you don't have any tests of the special handling for cyipopt duals. But otherwise this looks good.

@mrmundt mrmundt merged commit 3e27bce into Pyomo:main May 30, 2023
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.

7 participants