-
Notifications
You must be signed in to change notification settings - Fork 21
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
numobs
and getobs
support for Tables.jl's tables
#124
Conversation
Dispatching on |
done, seems to work well |
Codecov Report
@@ Coverage Diff @@
## main #124 +/- ##
==========================================
+ Coverage 88.72% 88.77% +0.04%
==========================================
Files 13 13
Lines 559 561 +2
==========================================
+ Hits 496 498 +2
Misses 63 63
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
I'll take a look at this soon. One question is the rational for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me. I just wonder about the choice viewhint=false
. Is this because MLUtils
generally tries (requires?) copies to be made by getobs
? In my own use-cases I am inclining towards avoiding the copy when that is possible (so viewhint=true
).
It might be nice to allow passing the viewhint
option through to getobs
, but perhaps that rubs against the current interface, and in any case could be added later?
Finally, perhaps we should check if there are likely overheads from the trait dispatch, as previously flagged. I see that SimpleTraits.jl has the utility @check_fast_traitdispach
. Perhaps that helps settle the issue.
One final note regarding documentation. I have been chastised for equating "istable(X) = true" with "satisfies the Tables.jl interface". The implication goes only in the "=>" direction: you can have |
|
dispatch is fast: julia> using MLUtils, SimpleTraits, Test
julia> x = (a=rand(3), b=rand(3));
julia> @check_fast_traitdispatch MLUtils.IsTable typeof(x) true
true |
@CarloLucibello Thanks for those explanations and your work here. |
Thanks to the recent introduction of the
subset
api in Tables.jl we can now support generic tables.Close #61, close #87