home / github / pull_requests

Menu
  • GraphQL API
  • Search all tables

pull_requests: 1304731317

This data as json

id node_id number state locked title user body created_at updated_at closed_at merged_at merge_commit_sha assignee milestone draft head base author_association auto_merge repo url merged_by
1304731317 PR_kwDOAMm_X85NxJ61 7731 closed 0 Continue to use nanosecond-precision Timestamps in precision-sensitive areas 6628425 <!-- Feel free to remove check-list items aren't relevant to your change --> This addresses the remaining cftime-related test failures in #7707 by introducing a function that always returns a nanosecond-precision Timestamp object. Despite no corresponding test failures, for safety I grepped and went ahead and replaced the `pd.Timestamp` constructor with this function in a few other areas. I also updated our documentation to replace any mentions of the "Timestamp-valid range" with "nanosecond-precision range" since Timestamps are now more flexible, and included a note that we have an issue open for relaxing this nanosecond-precision assumption in xarray eventually. While in principle I think it would be fine if `CFTimeIndex.to_datetimeindex` returned a `DatetimeIndex` with non-nanosecond-precision values, since we don't use `to_datetimeindex` anywhere outside of tests, in its current state it was returning nonsense values: ``` >>> import pandas as pd >>> import xarray as xr >>> times = xr.cftime_range("0001", periods=5) >>> times.to_datetimeindex() DatetimeIndex(['1754-08-30 22:43:41.128654848', '1754-08-31 22:43:41.128654848', '1754-09-01 22:43:41.128654848', '1754-09-02 22:43:41.128654848', '1754-09-03 22:43:41.128654848'], dtype='datetime64[ns]', freq=None) ``` This is due to the assumption in `cftime_to_nptime` that the resulting array will have nanosecond-precision values. We can (and should) address this eventually, but for the sake of quickly supporting pandas version two I decided to be conservative and punt this off to be part of #7493. `cftime_to_nptime` is used in places other than `to_datetimeindex`, so modifying it has other impacts downstream. 2023-04-06T13:06:50Z 2023-04-13T15:17:14Z 2023-04-13T14:58:34Z 2023-04-13T14:58:34Z c9c1c6d681b68d36c3145da3223f16d649fcf9ab     0 4e24ca83c650a144de356e52d532e5d2a05238a6 13a47fdb6b1a49d510e088113b5a86788d29eafb MEMBER   13221727 https://github.com/pydata/xarray/pull/7731  

Links from other tables

  • 3 rows from pull_requests_id in labels_pull_requests
Powered by Datasette · Queries took 0.729ms