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

Gams/Baron: ensure negative numbers are parenthesized #2833

Merged
merged 1 commit into from
May 20, 2023

Conversation

jsiirola
Copy link
Member

Fixes #2819 .

Summary/Motivation:

This resolves an issue where negative constants were not being parenthesized, which lead to incorrect expressions in certain contexts (like exponentiation)

Changes proposed in this PR:

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 emma58 May 20, 2023 03:47
@codecov
Copy link

codecov bot commented May 20, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.01 ⚠️

Comparison is base (47deef1) 87.18% compared to head (e20b685) 87.17%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2833      +/-   ##
==========================================
- Coverage   87.18%   87.17%   -0.01%     
==========================================
  Files         765      765              
  Lines       88471    88457      -14     
==========================================
- Hits        77134    77113      -21     
- Misses      11337    11344       +7     
Flag Coverage Δ
linux 84.25% <100.00%> (+<0.01%) ⬆️
osx 73.90% <100.00%> (ø)
other 84.42% <100.00%> (ø)
win 81.79% <100.00%> (ø)

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

Impacted Files Coverage Δ
pyomo/repn/plugins/gams_writer.py 86.00% <ø> (ø)
pyomo/repn/plugins/baron_writer.py 82.11% <100.00%> (ø)

... and 14 files with indirect coverage changes

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

@jsiirola jsiirola merged commit dca0388 into Pyomo:main May 20, 2023
@jsiirola jsiirola deleted the baron-writer-negative-linear branch May 20, 2023 04:58
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.

BARON Writer Outputs Inconsistent Constraint Expressions for Model with Fixed Var Objects
2 participants