-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
vcat with different AbstractVectors #2326
Comments
Ouch this is a tricky one. |
It's not a super high priority for DataFrames since we defined a local function to replace Something like this may also help another DataFrame issue: making |
Is this something that we still need to worry about? It doesn't seem like there is much we can do at this stage. An error is at least better, I would think, as is the case right now.
|
I think there is a solution to this problem. The core of it is that the
with
I know the latter is a bit of a hack, as one should usually use the promote_rule mechanism and possibly also only for the promotion in cooperation with array classes (not any type as shown here). But somehow I did not get the "promote_rule" mechanism to work properly for the generic types. This then also allowed to encapsulate an array in my Img class such that Array functions such as "+" will automatically work. In array.jl this required similar changes in the loops which generate the "+" routine, such that then the promotion rules are automatically used. Here is example code that demonstrates how to create a "derived" array which (so far partly) behaves the way it should. Note that the start of the program below are changes to the Julia core, which one may discuss to implement them permanently (after speed tests).
|
I just ran into some of these issues and posted about it over on julia-users. I'm going to post a separate issue about
In
By overloading it as I have, I can intercept every call to So far, so good, but this isn't quite enough when we're talking about different storage strategies. For example, what if we're using It's important to facilitate the overriding of default behavior here. The current implementations of The one complication in the |
This has been a major problem in Convex.jl; we've figured out a solution, but it's brittle, tricky, and computationally expensive. We want to be able to define |
Leaving a bread crumb to #17660 (comment), which could help in the near term. |
Could a design similar to broadcasts |
@dlfivefifty I think so, see #20815. |
Also, I think there should be a |
Partially fixed by #19305? |
This is type-piracy, but we cannot change that (until JuliaLang/julia#2326), so at least do not make these method intersections unnecessary slow and complicated for everyone who does not care about SparseArrays and does not load it, and unreliable for everyone who does load it.
This is type-piracy, but we cannot change that (until JuliaLang/julia#2326), so at least do not make these method intersections unnecessary slow and complicated for everyone who does not care about SparseArrays and does not load it, and unreliable for everyone who does load it.
This used to make a lot of references to design issues with the SparseArrays package (JuliaLang/julia#2326 / JuliaLang/julia#20815), which result in a non-sensical dispatch arrangement, and contribute to a slow loading experience do to the nonsense Unions that must be checked by subtyping.
This used to make a lot of references to design issues with the SparseArrays package (JuliaLang/julia#2326 / JuliaLang/julia#20815), which result in a non-sensical dispatch arrangement, and contribute to a slow loading experience do to the nonsense Unions that must be checked by subtyping. (cherry picked from commit 5a922fadfef083b83d983ac84f49a4460baa42ab) (cherry picked from commit 8fd5f279c8c81a8e59dec3852235c7dd5c88b143)
Currently,
vcat
on AbstractArrays uses the first argument to determine the type of AbstractArray to use for the result. A nice feature would be to have some sort of promotion that determines the result. In the example below, it would be nice to have a way to define that both of them return a DataArray (from the DataFrames package).The text was updated successfully, but these errors were encountered: