-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Datetime dev 2 #93
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
Datetime dev 2 #93
Conversation
Also move datetime string functions to their own source file.
…string Also add some tests using the pytz library.
…tions Also clean up the tests to work with the stricter date unit vs time unit boundary that has been added.
The events don't fit well within the datetime, causing many special cases and complicating the datetime code. A better way to proceed, which received approval from Travis with regard to the reason events were introduced in the first place, is to do the following: * Generalize the structured arrays so they work with ufuncs * Either use NPY_UBYTE, or introduce a new integer modulo N type * The structured dtype [('date', 'M8[D]'), ('event', 'u8')], then will operate identically to the design of events in datetime. These other changes will have much use elsewhere as well.
The default is 'same_kind', which allows data loss, but prevents crossing the date unit/time unit boundary. As a special case, printing dates with a timezone specified requires 'unsafe' casting.
…tion Since the datetime adds a new flexible dtype (datetime with generic units), updating all the places where flexible dtypes are adjusted was error-prone. Thus, this has been moved to a single place. At the same time, I've added sizes for the various number types, so they don't produce size-one strings by default anymore
* unrecognized inputs are converted to 'NaT' instead of throwing an error, | ||
* while with 'safe' casting an error will be thrown if any precision | ||
* from the input will be thrown away. | ||
* |
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.
Are the casting rules described in more detail somewhere?
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.
Not at the moment, but it should go in the documentation, yes.
Look like things are coming together. |
I'm OK with this. |
This pull request includes the following modifications: