Skip to content
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

ENH: non-nano Timestamp.timestamp, to_period #46990

Merged
merged 3 commits into from
May 11, 2022

Conversation

jbrockmendel
Copy link
Member

  • closes #xxxx (Replace xxxx with the Github issue number)
  • Tests added and passed if fixing a bug or adding a new feature
  • All code checks passed.
  • Added an entry in the latest doc/source/whatsnew/vX.X.X.rst file if fixing a bug or adding a new feature.

@@ -348,6 +348,19 @@ cdef int64_t periods_per_day(NPY_DATETIMEUNIT reso=NPY_DATETIMEUNIT.NPY_FR_ns) e
return day_units


cdef int64_t periods_per_second(NPY_DATETIMEUNIT reso) except? -1:
Copy link
Member

Choose a reason for hiding this comment

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

This can't be defined with periods_per_day because of timezones?

@@ -348,6 +348,19 @@ cdef int64_t periods_per_day(NPY_DATETIMEUNIT reso=NPY_DATETIMEUNIT.NPY_FR_ns) e
return day_units


cdef int64_t periods_per_second(NPY_DATETIMEUNIT reso) except? -1:
Copy link
Member

Choose a reason for hiding this comment

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

This can't be defined with periods_per_day because of timezones?

Copy link
Member Author

Choose a reason for hiding this comment

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

we could share for some cases, but for not for e.g. NPY_FR_h


if self._reso != NPY_FR_ns:
raise NotImplementedError(self._reso)

normalized = normalize_i8_stamp(local_val)
normalized = normalize_i8_stamp(local_val, ppd)
Copy link
Member

Choose a reason for hiding this comment

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

Do we have non-nano tests for normalize()?

Copy link
Member Author

Choose a reason for hiding this comment

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

not yet, still raises a few lines up, per commit message this is preliminary


if self._reso != NPY_FR_ns:
raise NotImplementedError(self._reso)

normalized = normalize_i8_stamp(local_val)
normalized = normalize_i8_stamp(local_val, ppd)
Copy link
Member

Choose a reason for hiding this comment

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

Do we have non-nano tests for normalize()?

@mroeschke mroeschke added Enhancement Non-Nano datetime64/timedelta64 with non-nanosecond resolution labels May 11, 2022
@mroeschke mroeschke modified the milestone: 1.5 May 11, 2022
Copy link
Member

@mroeschke mroeschke left a comment

Choose a reason for hiding this comment

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

Great sounds good.

@mroeschke mroeschke merged commit d49a244 into pandas-dev:main May 11, 2022
@jbrockmendel jbrockmendel deleted the nano-ts-5 branch May 11, 2022 15:10
yehoshuadimarsky pushed a commit to yehoshuadimarsky/pandas that referenced this pull request Jul 13, 2022
* ENH: Timestamp.timestamp non-nano

* ENH: Timestamp.to_period non-nano

* normalize prelims
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Non-Nano datetime64/timedelta64 with non-nanosecond resolution
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants