Skip to content

Avoid duplicate AMPLFUNC entries in ipopt_v2#3554

Merged
blnicho merged 6 commits intoPyomo:mainfrom
jsiirola:amplfunc-duplicates
Apr 14, 2025
Merged

Avoid duplicate AMPLFUNC entries in ipopt_v2#3554
blnicho merged 6 commits intoPyomo:mainfrom
jsiirola:amplfunc-duplicates

Conversation

@jsiirola
Copy link
Copy Markdown
Member

@jsiirola jsiirola commented Apr 8, 2025

Fixes # .

Summary/Motivation:

ipopt_v2 (from pyomo.contrib.solver) failed to check/remove duplicate entries when constructing the AMPLFUNC environment variable, which led to (numerous) warnings from ipopt for IDAES-like models. This PR ports the filter from the original ipopt interface and updates the filtering method to simplify it and remove some assumptions.

Changes proposed in this PR:

  • port use of amplfunc_merge from ipopt to ipopt_v2
  • rework amplfunc_merge to simplify logic (now that we are only supporting Python>3.7, dicts are deterministic)

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.

@jsiirola jsiirola requested a review from mrmundt April 9, 2025 20:41
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 10, 2025

Codecov Report

Attention: Patch coverage is 92.85714% with 1 line in your changes missing coverage. Please review.

Project coverage is 88.72%. Comparing base (a3a0f7d) to head (6c05592).
Report is 9 commits behind head on main.

Files with missing lines Patch % Lines
pyomo/contrib/solver/solvers/ipopt.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3554      +/-   ##
==========================================
+ Coverage   85.00%   88.72%   +3.71%     
==========================================
  Files         889      889              
  Lines      102128   102129       +1     
==========================================
+ Hits        86819    90617    +3798     
+ Misses      15309    11512    -3797     
Flag Coverage Δ
builders 26.57% <71.42%> (+<0.01%) ⬆️
default 84.84% <92.85%> (?)
expensive 33.97% <71.42%> (?)
linux 86.19% <92.85%> (+1.28%) ⬆️
linux_other 86.19% <92.85%> (?)
osx 76.12% <92.85%> (?)
win 84.69% <92.85%> (?)
win_other 84.69% <92.85%> (?)

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-project-automation github-project-automation bot moved this from Review In Progress to Reviewer Approved in Pyomo Release April 2025 Apr 14, 2025
@blnicho blnicho merged commit 0b58294 into Pyomo:main Apr 14, 2025
120 of 125 checks passed
@github-project-automation github-project-automation bot moved this from Reviewer Approved to Done in Pyomo Release April 2025 Apr 14, 2025
@jsiirola jsiirola deleted the amplfunc-duplicates branch April 14, 2025 14:20
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.

3 participants