Skip to content

Broadcast attributes #513

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

Merged
merged 1 commit into from
Aug 28, 2018
Merged

Broadcast attributes #513

merged 1 commit into from
Aug 28, 2018

Conversation

blegat
Copy link
Member

@blegat blegat commented Aug 28, 2018

I had to put Ref's in ECOS because of broadcasting attributes and now that I am updating SDOI, I need them again... Probably better to just define the attributes here as scalar :)

@blegat blegat added this to the 0.6.0 milestone Aug 28, 2018
@codecov-io
Copy link

codecov-io commented Aug 28, 2018

Codecov Report

Merging #513 into master will decrease coverage by 0.02%.
The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #513      +/-   ##
=========================================
- Coverage   95.62%   95.6%   -0.03%     
=========================================
  Files          46      46              
  Lines        4704    4705       +1     
=========================================
  Hits         4498    4498              
- Misses        206     207       +1
Impacted Files Coverage Δ
src/attributes.jl 95.65% <66.66%> (-1.41%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a2aa54e...9b669d2. Read the comment docs.

@@ -183,7 +189,7 @@ function get end
# We want to avoid being too specific in the type arguments to avoid method ambiguity.
# For model, get(::ModelLike, ::AbstractVariableAttribute, ::Vector{VariableIndex}) would not allow
# to define get(::SomeModel, ::AnyAttribute, ::Vector)
get(model::ModelLike, attr::AnyAttribute, idxs::Vector) = get.(model, Ref(attr), idxs)
get(model::ModelLike, attr::AnyAttribute, idxs::Vector) = get.(model, attr, idxs)
Copy link
Member

Choose a reason for hiding this comment

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

Do we still need this fallback or should users just broadcast themselves?

Copy link
Member Author

Choose a reason for hiding this comment

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

Some solvers may do something faster, e.g. if they have a fixed cost that can be shared when getting by group

@blegat blegat merged commit 0aba776 into master Aug 28, 2018
@odow odow deleted the bl/broadcastattr branch March 6, 2019 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants