Skip to content

Fix the NaT fixture data #131

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 3 commits into from
Nov 26, 2018
Merged

Fix the NaT fixture data #131

merged 3 commits into from
Nov 26, 2018

Conversation

jakirkham
Copy link
Member

Fixes the NaT test case and fixture data by ensuring -2**63 is included at high frequency. The reason for this is explained by the code below.

In [1]: import numpy as np                                                      

In [2]: np.float64(-0.0).view("m8")                                             
Out[2]: numpy.timedelta64('NaT')

In [3]: np.float64(-0.0).view("m8").view(np.int64)                              
Out[3]: -9223372036854775808

In [4]: -2**63                                                                  
Out[4]: -9223372036854775808

TODO:

  • Unit tests and/or doctests in docstrings
  • tox -e py37 passes locally
  • tox -e py27 passes locally
  • Docstrings and API docs for any new/modified user-facing classes and functions
  • Changes documented in docs/release.rst
  • tox -e docs passes locally
  • AppVeyor and Travis CI passes
  • Test coverage to 100% (Coveralls passes)

Previously this was trying to introduce NaT values by trying to get a
negative zero. However this did not work correctly. So this recenters
the range around the equivalent of negative zero in double values for
integers. Have verified this will introduce a few NaT values.
With the new range in use, regenerate the NaT fixture data.
Copy link
Member

@alimanfoo alimanfoo left a comment

Choose a reason for hiding this comment

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

LGTM

@jakirkham jakirkham merged commit 6a444e9 into zarr-developers:master Nov 26, 2018
@jakirkham jakirkham deleted the fix_nat_tst_data branch November 26, 2018 15:30
@alimanfoo alimanfoo mentioned this pull request Nov 26, 2018
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants