-
-
Notifications
You must be signed in to change notification settings - Fork 657
Register new package IteratorTraits.jl v0.0.1 #11692
Conversation
Bump, could this be merged? It had its 24 hours, right? This is part of the big breakup of Query into smaller, self-contained parts. |
What does |
The default implementation is just the identity function, so if Both Query and IterableTables follow this convention: when they have to handle something that can be iterated (i.e. I'm not super happy with this design. On one hand it kind of resembles the I should say that at some point I thought this would be a good addition to base, and that it would be cool if |
I've actually had the thought over the last week that maybe we shouldn't hold DataFrames hand so much w/ all the table-interops. We're going through all these indirections and extra hoops just for DataFrames. If DataFrames doesn't provide enough type information, then it won't have type-stable iterators. @nalimilan and I have discussed adding a |
💯 Agreed, this is a design decision in DataFrames. It would be great if DataFrames could just be fully-typed (ala https://github.com/JuliaComputing/IndexedTables.jl/blob/master/src/columns.jl), but that doesn't seem to be practical in all cases. So for the time being we probably need both DataFrames and TypedDataFrames. But, if the real purpose of this function is to add type-stability, then it could be called something like
|
I've actually been playing around w/ that exact definition here |
Well, for now I should also say that the same pattern is also used with a lot of the other iterable table sources, so it is useful far beyond just Just now saw @JeffBezanson comment. I think I actually had the name as I don't really feel strongly about the name, though. Having said that, I would like to merge this as is for now. Changing the name would be a major piece of work because there are just a lot of sinks and sources at this point that use this, spread over many packages. My idea for this PR is simply to move existing, working, functional stuff into a separate package, which is a very non-disruptive change to the ecosystem. Once this is registered and I've moved TableTraits over to use it, we can think about a rename. I think there is a way to do that smoothly and slowly, but I'd like to do that as a second step once I have a bit more time. |
Here is another version :). |
I just don't understand why there would be a generic hook to get another kind of iterator for an iterator. How do you know when to call or define it? I also think the issue extends beyond just the name. Type-stable iteration shouldn't be required for things to work. |
We've discussed that, but I don't think I said I was convinced encoding column types in the |
What is the next step here? I'd love if we found a better solution to this eventually, and even better, if that was a pattern in base, but in the meantime, can we merge this here? Query and IterableTables have used this for more than a year, it works and solves a problem and for now I just want to move the various bits and pieces from the original Query.jl into smaller packages so that I can enable new integration scenarios without forcing folks to take a dependency on Query.jl. |
I don't think there's any need to add |
It sounds like this is the real problem. DataFrame should just adopt row iteration, which IIUC is the protocol for tabular data. |
Yes, we've discussed doing that. But in R iteration happens over columns, so leave me a bit of time to adapt mentally. There's also the issue that |
Bump, can this please be merged now? Its been four days since I opened this PR. We can iterate over the precise naming of the things in this package as times goes on, but as far as I understand the package registration process, this should just be registered at this point because I don't intend to make any changes for version v0.0.1. |
This package has a very official sounding name. I have problems merging something with this name that is 3-4 lines of code that seems to mostly be to try something out. I would suggest using something less official sounding (see https://github.com/MikeInnes/TakingBroadcastSeriously.jl for inspiration) and then if this turns out to be useful, it would be simple to rename the package. |
This is not trying something out. This is splitting things that have been working well for more than a year in a pretty widely used package (Query.jl) into smaller pieces so that things become more composable. It will allow folks to integrate more closely with Query.jl without having to take a dependency on Query.jl. It will also allow me to not have Query.jl depend on TableTraits.jl and friends anymore. There is literally zero question whether this is useful or not, it has been useful for a long while. |
This does not define any Traits for Iterators in the sense that a Trait is used throughout the Julia community. It also uses interactive features not meant to be called in actual code like A |
The package name really shouldn't have So what this package provides is 1) a way to test whether a type is iterable, 2) a way to get an iterator that is type stable and 3) it will provide JuliaLang/julia#22467 in a package. None of these are Query.jl specific, all of them might well find use in entirely different scenarios outside the Query-verse and all of them apply to general iterators. Re the use of Other potential names might be |
If that's really what this is for, great, but then it should be named appropriately and actually implement that functionality. |
Are you suggesting a name change for the package or for the
I don't understand that part. While I appreciate these design suggestions, at this point I would like to get clear guidance what I need to do to get this registered. I take it that @KristofferC wants a different name for the package, that seems fair game for the registration review here, so if I could get feedback on the alternative proposals I made, or some alternative suggestions, it would be great. For now I'm interpreting all the other comments about the design of the package itself as suggestions. I really appreciate them, but my understanding of the policy for package registration is that those are suggestions and that a package author is free to incorporate them or not. In this case I plan to do that, but not at this point. |
I second @KristofferC 's opinion on the name. IteratorTraits sounds pretty comprehensive and official. It also seems like this could stay within TableTraits, which is also a very small package, so depending on it shouldn't really be a problem. |
I don't want to keep this stuff in TableTraits because I want to decouple QueryOperators from TableTraits by removing the dependency of QueryOperators on TableTraits (for a lot of reasons related to some future plans around TableTraits). Perfectly happy to rename the package, though. Any thoughts about the alternative names I suggested? Any other naming ideas? |
Would If folks don't like that, I would appreciate other name suggestions that a) don't include the term "query" and b) ideally include the term "iterator" in some form. |
I don't understand. What is in the package right now is a function that does what |
Other packages are adding methods to both functions for their own types, i.e. this package here defines the functions that one can implement for ones own types. I guess a comparable situation would be a package that defines the base iterator interface: it would define the functions |
Repository: davidanthoff/IteratorTraits.jl Please make sure that:
@davidanthoff This PR will remain open for 24 hours for feedback (which is optional). If you get feedback, please let us know if you are making changes, and we'll merge once you're done. |
b978c11
to
c366e75
Compare
I've added the |
Alright, this one can be closed, superseded by #11800, as suggested on slack. |
Repository: davidanthoff/IteratorTraits.jl![Travis Build Status](https://camo.githubusercontent.com/7a2e4021b569a02a9548ab040c642e5ef3d7ce607be119b141bdd3b77dfd0929/68747470733a2f2f6170692e7472617669732d63692e6f72672f6461766964616e74686f66662f4974657261746f725472616974732e6a6c2e7376673f6272616e63683d76302e302e31)
Release: v0.0.1
Travis:
cc: @davidanthoff
Please make sure that:
@davidanthoff This PR will remain open for 24 hours for feedback (which is optional). If you get feedback, please let us know if you are making changes, and we'll merge once you're done.