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 some more instances to the GDP constrained layout example #2838

Merged
merged 13 commits into from
Jun 14, 2023

Conversation

sadavis1
Copy link
Contributor

Fixes # .

Summary/Motivation:

(remaking PR to use branch properly)
Adds some additional example instances from Sawaya (2006) to this GDP constrained layout example, and adds some drawings.

Changes proposed in this PR:

  • Add additional problem instances
  • Add matplotlib drawing code
  • Add euclidean distance option

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
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.

A few small nits, but this looks good!

examples/gdp/constrained_layout/cons_layout_model.py Outdated Show resolved Hide resolved
examples/gdp/constrained_layout/cons_layout_model.py Outdated Show resolved Hide resolved
examples/gdp/constrained_layout/cons_layout_model.py Outdated Show resolved Hide resolved
transformer.apply_to(model)
solver.solve(model)
print(f"Found objective function value: {model.min_dist_cost()}")
draw_model(model, title=(key if d == "l1" else f"{key} ({d} distance)"))
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor nit, but why not put which norm in the title all the time?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hm. I think I wrote it like this because the l1 norm was the "default" problem specified in the paper and the euclidean distance was a variant invented by me. I can change it though, it should only make things clearer.

@sadavis1
Copy link
Contributor Author

I've made some changes to resolve these issues, please let me know if there are any others.

@codecov
Copy link

codecov bot commented Jun 13, 2023

Codecov Report

Patch coverage: 53.73% and project coverage change: -0.03 ⚠️

Comparison is base (5e16a1b) 87.48% compared to head (8d41c30) 87.45%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2838      +/-   ##
==========================================
- Coverage   87.48%   87.45%   -0.03%     
==========================================
  Files         771      771              
  Lines       89598    89650      +52     
==========================================
+ Hits        78383    78404      +21     
- Misses      11215    11246      +31     
Flag Coverage Δ
linux 84.52% <53.73%> (-0.03%) ⬇️
osx 74.58% <53.73%> (-0.02%) ⬇️
other 84.70% <53.73%> (-0.03%) ⬇️
win 82.10% <53.73%> (-0.04%) ⬇️

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

Impacted Files Coverage Δ
...amples/gdp/constrained_layout/cons_layout_model.py 69.00% <53.73%> (-31.00%) ⬇️

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

@emma58
Copy link
Contributor

emma58 commented Jun 14, 2023

@blnicho, @mrmundt this is only failing coverage, which is kind of its own can of worms since it's in examples and we don't have tests to begin with... Are y'all okay with merging anyway?

@blnicho
Copy link
Member

blnicho commented Jun 14, 2023

@emma58 I'm fine with merging this. Consistent testing of the code in the examples directory is a bigger issue (#101)

@emma58 emma58 merged commit f05afcb into Pyomo:main Jun 14, 2023
@sadavis1 sadavis1 mentioned this pull request Aug 1, 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.

6 participants