Skip to content

DOC: for datetime64 support #9794

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

Merged
merged 1 commit into from
Nov 16, 2017
Merged

Conversation

jklymak
Copy link
Member

@jklymak jklymak commented Nov 16, 2017

PR Summary

Should have been in #9779. Sorry!

PR Checklist

  • Has Pytest style unit tests
  • Code is PEP 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way


Matplotlib has supported `datetime.datetime` dates for a long time. We
now support `numpy.datetime64` dates as well. This should be
transparent to the user, and anywhere that `dateime.datetime` could be
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think "this should be transparent to the user" falls into the "this is simple/obvious/easy" ableist type language that I think should be avoided when possible.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just meant they shouldn't have to do anything special to make it happen. i.e. there is no new API, they just use plot or date2num as they always have.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it might be clearer to say that? np.datetime is now a supported type, so np.datetime objects can now be used as data inputs to any plotting function that already supports dates.

and num2date

All matplotlib date plotting is done by converting date instances into days
since 0001-01-01 00:00:00 UTC plus one day (for historical reasons). The
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What historical reasons? Is there a link to the discussion anywhere?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome. can you link to that discussion in this text to provide context.

@jklymak jklymak force-pushed the docdatetime64 branch 2 times, most recently from a9e5209 to 3e3d984 Compare November 16, 2017 15:24
@jklymak jklymak changed the title DOC: for datetime64 support WIP: DOC: for datetime64 support Nov 16, 2017
@jklymak jklymak changed the title WIP: DOC: for datetime64 support DOC: for datetime64 support Nov 16, 2017
@jklymak
Copy link
Member Author

jklymak commented Nov 16, 2017

This is OK. Couldn't get inter sphinx numpy.datetime64 to give a link. Any idea what I'm doing wrong?

@dstansby
Copy link
Member

Maybe try :numpy:class:`datetime64` ?

@jklymak
Copy link
Member Author

jklymak commented Nov 16, 2017

That doesn't appear anywhere else in the codebase. Others have use numpy.datetime64 elsewhere in the docs, so I'll leave as that and open an issue about the intersphinx issue...

EDIT: I'll try again w/ :class:numpy.datetime64

@jklymak
Copy link
Member Author

jklymak commented Nov 16, 2017

That doesn't work either. Opened issue... #9802

@story645 story645 merged commit 5104625 into matplotlib:master Nov 16, 2017
@QuLogic QuLogic modified the milestones: needs sorting, v2.2.0 Feb 12, 2018
@jklymak jklymak deleted the docdatetime64 branch March 5, 2019 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants