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

Remove eltype_plus #17398

Merged
merged 2 commits into from
Jul 26, 2016
Merged

Conversation

martinholters
Copy link
Member

Left over from #17313.

Note that DataFrames uses eltype_plus, so either this needs a deprecation (but am I right that I cannot put that in deprecated.jl because it has to go in the Broadcast submodule?) or DataFrames should get some lead time to use promote_eltype_op(+, ...) instead.

@tkelman
Copy link
Contributor

tkelman commented Jul 13, 2016

You could try evaling the deprecation into the Broadcast module from deprecated.jl, I think that's done once or twice in there. Probably easier to just go fix DataArrays though?

@martinholters
Copy link
Member Author

Probably easier to just go fix DataArrays though?

Yes, that would require a VERSION check as promote_eltype_op isn't in 0.4, but that doesn't sound too bad, I guess. I'll prepare a PR.

@tkelman
Copy link
Contributor

tkelman commented Jul 13, 2016

Has anyone added promote_eltype_op to Compat yet? That would be another approach and might end up being useful for packages other than DataArrays at some point.

@martinholters
Copy link
Member Author

Has anyone added promote_eltype_op to Compat yet?

No, but that sounds like a good idea indeed.

body = gen_broadcast_body_sparse(op, true)
OP = Symbol(string(op))
@eval begin
function ($OP){Tv1,Ti1,Tv2,Ti2}(A_1::SparseMatrixCSC{Tv1,Ti1}, A_2::SparseMatrixCSC{Tv2,Ti2})
if size(A_1,1) != size(A_2,1) || size(A_1,2) != size(A_2,2)
throw(DimensionMismatch(""))
end
Tv = ($pro)(A_1, A_2)
Tv = promote_eltype_op($op, A_1, A_2)
Copy link
Contributor

Choose a reason for hiding this comment

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

Since you have the types as parameters in the function is better to use promote_op directly. E.g. Tv = promote_op($op, Tv1, Tv2). Also if #17389 gets merged promote_eltype_op should return a better type in general but it won't be inferrable (the same applies below).

Copy link
Member Author

Choose a reason for hiding this comment

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

Since you have the types as parameters in the function is better to use promote_op directly.

Not sure why, but I don't see any harm either, update is coming.

@martinholters
Copy link
Member Author

martinholters commented Jul 20, 2016

Preconditions for merging this:

@andreasnoack
Copy link
Member

@martinholters martinholters changed the title RFC: Remove eltype_plus Remove eltype_plus Jul 26, 2016
@martinholters
Copy link
Member Author

Ready from my side, but no need to rush it into 0.5, I guess.

@ViralBShah
Copy link
Member

Do tag 0.5.x if you think it should get into the 0.5 release at some point.

@tkelman
Copy link
Contributor

tkelman commented Jul 26, 2016

It's probably safe to do now since we were careful about it, but even safer to wait until we branch and not backport the deletion since there may be unregistered code using it.

@JeffBezanson JeffBezanson merged commit 36ed21a into JuliaLang:master Jul 26, 2016
@martinholters martinholters deleted the rem_eltype_plus branch October 6, 2016 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
types and dispatch Types, subtyping and method dispatch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants