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

A few more GDP examples #2932

Merged
merged 18 commits into from
Sep 19, 2023
Merged

A few more GDP examples #2932

merged 18 commits into from
Sep 19, 2023

Conversation

sadavis1
Copy link
Contributor

@sadavis1 sadavis1 commented Aug 1, 2023

Fixes # .

Summary/Motivation:

Early in the summer, I worked on a few GDP example problems, the first of which was merged in #2838 . This PR contains the other two GDP example problems from Sawaya (2006) that I implemented. The code solves simple geometric problems and draws pretty pictures.

Changes proposed in this PR:

  • Add "Circles" and "Farm Layout" example code and instance data
  • Add matplotlib drawing code for each

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

codecov bot commented Aug 8, 2023

Codecov Report

Patch coverage has no change and project coverage change: -0.01% ⚠️

Comparison is base (0e0f0cd) 88.09% compared to head (448b14a) 88.08%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2932      +/-   ##
==========================================
- Coverage   88.09%   88.08%   -0.01%     
==========================================
  Files         769      769              
  Lines       89493    89493              
==========================================
- Hits        78836    78832       -4     
- Misses      10657    10661       +4     
Flag Coverage Δ
linux 85.18% <ø> (-0.01%) ⬇️
osx 74.99% <ø> (ø)
other 85.36% <ø> (ø)
win 82.43% <ø> (ø)

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

see 1 file with indirect coverage changes

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

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.

This looks good! Just a few nits.

examples/gdp/circles/circles.py Outdated Show resolved Hide resolved
examples/gdp/circles/circles.py Outdated Show resolved Hide resolved
examples/gdp/circles/circles.py Show resolved Hide resolved
examples/gdp/circles/circles.py Outdated Show resolved Hide resolved
examples/gdp/farm_layout/farm_layout.py Outdated Show resolved Hide resolved
examples/gdp/farm_layout/farm_layout.py Outdated Show resolved Hide resolved
@bernalde
Copy link
Contributor

This might be a more involved discussion than this PR, but where should we draw the line between a set of examples, tests, and supported models? In particular, for GDP, we have GDPLib https://github.com/SECQUOIA/gdplib, which could host these two examples. What's the motivation for adding them to the main Pyomo repository?

@blnicho
Copy link
Member

blnicho commented Aug 22, 2023

@bernalde I think this is a great discussion to have outside of this PR. We are inconsistent with how examples are written and tested and also with where they live (both within and outside of the Pyomo repo). I'll open a PEP to start a more comprehensive discussion on this but I don't think this PR needs to wait for it to be resolved.

@sadavis1
Copy link
Contributor Author

I've made the fixes requested, but I can't answer the broader question about where examples should live and how or if they should be tested. These aren't tested for now, since none of their neighbors were.

@blnicho
Copy link
Member

blnicho commented Aug 23, 2023

@sadavis1 I cancelled the tests to free up GHA resources while we're finalizing things for the release. I'll relaunch them when we're done.

@blnicho blnicho requested a review from emma58 September 5, 2023 18:56
@emma58 emma58 merged commit 6bdbb5d into Pyomo:main Sep 19, 2023
32 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