Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Convert NaT to nan in date2num#10631

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
dopplershift merged 1 commit intomatplotlib:masterfromefiring:convert_NaT
Mar 1, 2018

Conversation

efiring
Copy link
Member

@efiringefiring commentedFeb 28, 2018
edited by dopplershift
Loading

PR Summary

Numpy datetime64 uses a flag value for Not a Time ("NaT"). When converting from datetime64 to Matplotlib's datenum,dates.date2num now substitutesnp.nan for "NaT".

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

@jklymakjklymak self-assigned thisFeb 28, 2018
@jklymak
Copy link
Member

Thanks@efiring. I'll review after the tests have passed.

@jklymak
Copy link
Member

One of the 3.5 tests doesn't like this change, though oddly other tests are Ok w/ it...

lib/matplotlib/dates.py:442: in date2num

@efiring
Copy link
MemberAuthor

It's failing on a line in the original code, not a line that I added. Numpy version is 1.10 on the failing test. My PR adds the datetime64[ns] to all the checks because that is the variant that Pandas uses--I suspect that is why we are seeing the failure.

>       extra = d - d.astype('datetime64[s]').astype(d.dtype)E       TypeError: Cannot cast ufunc subtract input from dtype('<M8') to dtype('<M8[s]') with casting rule 'same_kind'

@jklymak
Copy link
Member

... but the old code has been passing... 🐑

@efiringefiring added this to thev2.2.0 milestoneFeb 28, 2018
@efiring
Copy link
MemberAuthor

I know it's late, but I think this is simple enough and important enough to be considered for v2.2.

jklymak reacted with thumbs up emoji

@jklymak
Copy link
Member

Agree that this should go in: thedatenum64 stuff is new anyways, it should be shipped w/o a missing feature like this if at all possible.

Copy link
Contributor

@dopplershiftdopplershift left a comment

Choose a reason for hiding this comment

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

Looks good to me. I'll leave it open a bit to let anyone else comment.

@dopplershiftdopplershift merged commit2d14a31 intomatplotlib:masterMar 1, 2018
tacaswell added a commit that referenced this pull requestMar 2, 2018
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@dopplershiftdopplershiftdopplershift approved these changes

@jklymakjklymakjklymak approved these changes

Assignees

@jklymakjklymak

Labels
None yet
Projects
None yet
Milestone
v2.2.0
Development

Successfully merging this pull request may close these issues.

3 participants
@efiring@jklymak@dopplershift

[8]ページ先頭

©2009-2025 Movatter.jp