-
Notifications
You must be signed in to change notification settings - Fork 52
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
Might Tables.jl be a new Home for StatsPlots.@df
?
#287
Comments
I don't think Tables.jl is the right place for it. Maybe we should just have a TablePlots.jl package similar to how we have TableOperations.jl? |
That doesn't make sense, since this macro is not tied to plotting at all. It works for any function call/ block of function calls. It's only historic accident that it ended up in StatsPlots.jl, since there was no Table interface back then. The only thing that is kind of plotting related is the automatic passing of a |
This sounds like something which could live in DataFramesMeta (with a different name). Cc: @pdeffebach @bkamins |
Can someone try and see how much of the |
I already checked it. |
Ah. Current implementation of |
So if we document that Other than that |
Thats a good idea. Could we then move |
Tables.jl is supposed to be lightweight interface package that other packages depend on, not something where convenience functions intended for end users should live. I don't think any package exists currently for that. |
Perhaps TableOperations.jl? |
Sounds good to me |
One problem is the current implementation relies on |
could be extracted to Tables.jl if all agree it is useful to have it there (we probably would need to restrict |
@quinnj What do you think? |
Yeah, I'd be down for that. If someone can make a PR, we're getting close to doing a new minor release here soon once I get the |
I will make a PR since we need to sync it with DataFrames.jl 1.4 release. |
@quinnj - why does
|
Also let us confirm that the definition of
The idea is:
What is an important corner case is when a table is a vector. Then This is what we need in DataFrames.jl, but I want to confirm that the same expectation is OK for Tables.jl. |
Better always treat the argument as a table, otherwise the behavior is inconsistent. Do we really need the |
I know and that is why I am asking. The problem is that whatever you do if you write in DataFrames.jl e.g.:
you get a no-op, while if you made
so it would be a change in DataFrames.jl (moreover - a change that we do not want). |
Which means that maybe we need to restrict |
I have a diff locally that changes it to: const ColumnTable = NamedTuple{names, T} where {names, T <: NTuple{N, AbstractVector{S} where S}} where {N} as I also noticed this definition being too general. |
Then this is problematic. Vectors of named tuples are generally considered as completely valid tables, so it would be weird for them not to work with |
If we want to move
is a desired behavior (and not transforming it to named tuples as I have shown above)
As I have said - the only thing that we can do is restrict Note that it is only a problem if |
I have opened #293 as a follow up to |
My fear is rather that custom table types will override
I think the difficulty is that we designed |
|
Right. The point is that as soon as people start using |
I agree. That is why I tried to highlight in the documentation that the default API is vectors, and |
The
@df
macro allows writing column names in function calls as inIt will be removed from StatsPlots.jl probably in 1.0 and if we don't find a better home, it will got to
Plots.jl
(JuliaPlots/Plots.jl#3351), but actually I think it should be somewhere more general purpose.If it's going here it should be probably be renamed to something like
@table
.The text was updated successfully, but these errors were encountered: