Skip to content

Add external function library #3648

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

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Add external function library #3648

wants to merge 10 commits into from

Conversation

eslickj
Copy link
Contributor

@eslickj eslickj commented Jun 26, 2025

Fixes None

Summary/Motivation:

Add and external function library for useful functions that are not easily implemented as Pyomo expressions.

Changes proposed in this PR:

  • Add external function library to Pyomo extensions

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.

Copy link

codecov bot commented Jun 29, 2025

Codecov Report

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

Project coverage is 88.93%. Comparing base (fe163bf) to head (79d0d55).
Report is 22 commits behind head on main.

Files with missing lines Patch % Lines
pyomo/contrib/external_functions/build.py 88.88% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3648   +/-   ##
=======================================
  Coverage   88.93%   88.93%           
=======================================
  Files         889      891    +2     
  Lines      102486   102499   +13     
=======================================
+ Hits        91144    91161   +17     
+ Misses      11342    11338    -4     
Flag Coverage Δ
builders 26.68% <92.30%> (+0.02%) ⬆️
default 85.52% <92.30%> (?)
expensive 34.04% <92.30%> (?)
linux 86.74% <92.30%> (-1.95%) ⬇️
linux_other 86.74% <92.30%> (+<0.01%) ⬆️
osx 83.04% <92.30%> (+<0.01%) ⬆️
win 84.95% <92.30%> (+<0.01%) ⬆️
win_other 84.95% <92.30%> (+<0.01%) ⬆️

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.

@unittest.skipUnless(flib, 'Could not find the "external" library')
class TestAMPLExternalFunction(unittest.TestCase):

@unittest.skipIf(is_pypy, "Cannot evaluate external functions under pypy")
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not move this to the class level rather than put it on every single test?

@blnicho blnicho moved this from Todo to Review In Progress in July 2025 Release Jul 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Review In Progress
Development

Successfully merging this pull request may close these issues.

5 participants