-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Allow reshape, ravel, transpose etc. of Time objects #3224
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
Conversation
|
@taldcroft - I got to implementing the Time shape manipulation routines, using a new private version of With this in place, it will become quite easy to support |
b1b33fc to
baa9a7f
Compare
|
@mhvk - cool! I did a quick scan to see what's happening, and hope to have a more detailed look in the next few days. |
|
@taldcroft - thanks! One question to ponder: In the present PR, I'm going somewhat out of my way to keep the shape of |
de4b658 to
e037ad8
Compare
|
@taldcroft - one more thing: now that I'm adding more methods, I'm starting to wonder whether I put the documentation for |
|
@mhvk - Re: broadcasting of Time vals like |
docs/time/index.rst
Outdated
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.
Per your question about location of these docs, I think it would be good to just make a new section here entitled Numpy method analogs. In this section explicitly list all the numpy-like methods that are supported. Discuss when memory is shared or not (i.e. just say that it is the same as Numpy, but some readers won't necessarily know what that means offhand). I don't think of take as a "shape-changing" method as much as an item selection method, but anyway calling these "Numpy analogs" seems more clear to me.
|
@mhvk - finished my review with relatively minor comments, this is awesome work! This is a good example of writing a (rather complicated) numpy container class as opposed to subclassing. You can start having fun filling in all the methods! 😄 Slightly OT, I wonder if it would be possible to factor things out so we don't just have a monster |
|
@taldcroft - thanks for the comments. I'll try to get to them shortly. In the meantime:
Agreed. I think we could have the different time formats separately ( |
|
@mhvk - the refactor suggestion makes sense. |
|
@mhvk - just want to check that you're not waiting on me for this. I just had a few minor comments. I was going to try writing a TimeColumnInfo subclass in #3731 that does the right thing for |
|
@taldcroft - the delay is solely because of other obligations. Hope to get to this and the column info class later this week. |
e037ad8 to
a28ed8d
Compare
957af15 to
ea95e98
Compare
|
@taldcroft - finally got around to updating the shape-changing methods for |
Add tests to ensure __getitem__ is OK with broadcasted attributes.
Also correct links.
5b75ea2 to
2af18f4
Compare
|
@taldcroft - with appveyer now working again, this passes all tests. Could you have a last look? I did end up just broadcasting dimensions for |
Allow reshape, ravel, transpose etc. of Time objects
With
Timebecoming multidimensional (#3138), it has acquired ashapeandsize. This could be taken further andTImecould also acquire otherndarrayshape-associated properties and methods, such asreshape,ravel,transpose, etc. This is not difficult in principle, though some care must be taken with properly reshaping other array properties as well (location,_delta_ut1_utc,_delta_tdb_tt).EDIT: for
Tablemixin purposes with grouping, sorting would also be good (includingargsort).