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

Interfaces to the SAS solvers #2886

Merged
merged 28 commits into from
Jul 3, 2024
Merged

Interfaces to the SAS solvers #2886

merged 28 commits into from
Jul 3, 2024

Conversation

phchri
Copy link
Contributor

@phchri phchri commented Jun 23, 2023

Fixes

Provides an interface to the SAS LP/MILP optimization solvers.

Summary/Motivation:

Provides an interface to the SAS LP/MILP optimization solvers on both the legacy 9.4 platform (via the saspy package) and on the SAS Viya cloud platform (CAS, via the swat package).

I'm repurposing the solver_io option to choose between the two interfaces, if there is a better way to do this, please advise. The idea is that the interface chooses automatically depending on which package is available.

Changes proposed in this PR:

  • Add the solver interface classes
  • Add 52 SAS specific unit tests for the two interfaces, two are currently skipped because the status between LP and MILP is inconsistent (still investigating what's going on there, probably just a status reporting inconsistency on the solver side).

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.

@phchri phchri changed the title Sassolvers Interfaces to the SAS solvers Jun 23, 2023
Copy link
Contributor

@mrmundt mrmundt left a comment

Choose a reason for hiding this comment

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

Thanks for this PR! Overall, it looks good; however, we do not (as far as I am aware) have SAS in our testing environment. I will approve GitHub Actions to run for this PR to confirm.

Please look at the two test_*.yml files in https://github.com/Pyomo/pyomo/tree/main/.github/workflows

pyomo/solvers/tests/checks/test_SAS.py Show resolved Hide resolved
pyomo/solvers/tests/checks/test_SAS.py Show resolved Hide resolved
pyomo/solvers/tests/checks/test_SAS.py Outdated Show resolved Hide resolved
pyomo/solvers/plugins/solvers/SAS.py Show resolved Hide resolved
pyomo/solvers/plugins/solvers/SAS.py Outdated Show resolved Hide resolved
pyomo/solvers/plugins/solvers/SAS.py Outdated Show resolved Hide resolved
pyomo/solvers/plugins/solvers/SAS.py Outdated Show resolved Hide resolved
@mrmundt
Copy link
Contributor

mrmundt commented Jun 26, 2023

Confirmed my previous comment: https://github.com/Pyomo/pyomo/actions/runs/5374476640/jobs/9760403183?pr=2886#step:24:8439 <- SAS tests are skipped.

@phchri
Copy link
Contributor Author

phchri commented Jun 26, 2023

Confirmed my previous comment: https://github.com/Pyomo/pyomo/actions/runs/5374476640/jobs/9760403183?pr=2886#step:24:8439 <- SAS tests are skipped.

Too bad, I was hoping you might have an academic version of at least SAS 9.4 available somewhere.

I ran the unit tests with various SAS versions in my environment, is this good enough for you?

@mrmundt
Copy link
Contributor

mrmundt commented Jun 26, 2023

Too bad, I was hoping you might have an academic version of at least SAS 9.4 available somewhere.

I ran the unit tests with various SAS versions in my environment, is this good enough for you?

Unfortunately, no. Because this PR proposes adding the solver into the core offering of Pyomo, we need to ensure its capabilities on our various Python and OS versions before it can be merged.

If you have information on how we might go about obtaining an academic license, we are willing to pursue that.

@phchri
Copy link
Contributor Author

phchri commented Jun 26, 2023

I will investigate how to most easily give you a license or access to machines that run SAS. I'll get back to you as soon as I hear something.

Which institution would a license be for?

@mrmundt
Copy link
Contributor

mrmundt commented Jun 26, 2023

I will investigate how to most easily give you a license or access to machines that run SAS. I'll get back to you as soon as I hear something.

Which institution would a license be for?

Thank you! The primary developers are at Sandia National Laboratories, so likely there. Please feel free to email wg-pyomo@sandia.gov so we can discuss further.

@codecov
Copy link

codecov bot commented Jun 26, 2023

Codecov Report

Patch coverage: 24.25% and project coverage change: -0.24% ⚠️

Comparison is base (176015b) 87.83% compared to head (ac2dfa3) 87.59%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2886      +/-   ##
==========================================
- Coverage   87.83%   87.59%   -0.24%     
==========================================
  Files         770      771       +1     
  Lines       89642    89976     +334     
==========================================
+ Hits        78733    78814      +81     
- Misses      10909    11162     +253     
Flag Coverage Δ
linux 84.64% <24.25%> (-0.23%) ⬇️
osx 74.40% <24.25%> (-0.19%) ⬇️
other 84.81% <24.25%> (-0.23%) ⬇️
win 81.90% <24.25%> (-0.22%) ⬇️

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

Files Changed Coverage Δ
pyomo/solvers/plugins/solvers/SAS.py 24.02% <24.02%> (ø)
pyomo/solvers/plugins/solvers/__init__.py 100.00% <100.00%> (ø)

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

@mrmundt mrmundt self-requested a review August 15, 2023 18:46
@mrmundt
Copy link
Contributor

mrmundt commented Mar 5, 2024

Good news, @phchri ! We have SAS approval for our test machines.

Copy link
Member

@blnicho blnicho left a comment

Choose a reason for hiding this comment

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

I found a few small typos in comments and one in an error message but otherwise this looks good.

pyomo/solvers/plugins/solvers/SAS.py Outdated Show resolved Hide resolved
pyomo/solvers/plugins/solvers/SAS.py Outdated Show resolved Hide resolved
pyomo/solvers/plugins/solvers/SAS.py Outdated Show resolved Hide resolved
pyomo/solvers/plugins/solvers/SAS.py Outdated Show resolved Hide resolved
pyomo/solvers/plugins/solvers/SAS.py Outdated Show resolved Hide resolved
pyomo/solvers/plugins/solvers/SAS.py Outdated Show resolved Hide resolved
@blnicho blnicho merged commit 4c81a6c into Pyomo:main Jul 3, 2024
29 of 33 checks passed
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.

5 participants