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 specific dispatch for >= constraints. #81

Merged
merged 15 commits into from
Nov 26, 2023
Merged

Add specific dispatch for >= constraints. #81

merged 15 commits into from
Nov 26, 2023

Conversation

pedromxavier
Copy link
Member

This PR is a first move towards avoiding bridges, as part of an initiative to better interact with JuMP's attribute system.

Copy link

codecov bot commented Nov 20, 2023

Codecov Report

Attention: 66 lines in your changes are missing coverage. Please review.

Comparison is base (a0cd57c) 80.92% compared to head (a10e4c2) 84.76%.

Files Patch % Lines
src/compiler/constraints.jl 69.76% 26 Missing ⚠️
src/attributes/compiler.jl 87.50% 15 Missing ⚠️
src/attributes/solver.jl 60.86% 9 Missing ⚠️
src/compiler/variables.jl 83.87% 5 Missing ⚠️
src/compiler/build.jl 72.72% 3 Missing ⚠️
src/compiler/error.jl 78.57% 3 Missing ⚠️
src/compiler/penalties.jl 75.00% 3 Missing ⚠️
src/compiler/parse.jl 93.33% 1 Missing ⚠️
src/encoding/variables/set/one_hot.jl 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #81      +/-   ##
==========================================
+ Coverage   80.92%   84.76%   +3.83%     
==========================================
  Files          31       30       -1     
  Lines        1143     1385     +242     
==========================================
+ Hits          925     1174     +249     
+ Misses        218      211       -7     

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

Copy link
Collaborator

@bernalde bernalde left a comment

Choose a reason for hiding this comment

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

Just leaving behind some comments, not to block the merge. Feel free to address them

s::GT{T},
arch::AbstractArchitecture,
) where {T}
# Scalar Affine Inequality Constraint: g(x) = a'x - b ≥ 0
Copy link
Collaborator

Choose a reason for hiding this comment

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

Usually the notation always covers the <= case first. Why this choice?

Copy link
Member Author

Choose a reason for hiding this comment

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

The idea is that we have internal functions who will be shared by both cases. We want to avoid using bridges for this and handle them manually instead.


return nothing
end

Copy link
Collaborator

Choose a reason for hiding this comment

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

There are several warnings from codecov where lines are not covered by tests. Should we work on these before merging?

Copy link
Member Author

Choose a reason for hiding this comment

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

Most are due to new attributes, it will be straightforward to cover them.

end

return nothing
end
Copy link
Collaborator

Choose a reason for hiding this comment

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

It is a good test, but I like that tests also highlight examples from the literature so that we can always reference them. Can we use some of the ones that I showed in recent documents?

Copy link
Member Author

Choose a reason for hiding this comment

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

Of course!

@pedromxavier pedromxavier merged commit 7aa2379 into master Nov 26, 2023
6 checks passed
@pedromxavier pedromxavier deleted the pr/fix-gt branch November 27, 2023 16:28
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.

3 participants