home / github / pull_requests

Menu
  • GraphQL API
  • Search all tables

pull_requests: 1854627268

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
1854627268 PR_kwDOAMm_X85ui13E 8999 open 0 Port negative frequency fix for `pandas.date_range` to `cftime_range` 6628425 <!-- Feel free to remove check-list items aren't relevant to your change --> Like `pandas.date_range`, `cftime_range` would previously return dates outside the range of the specified start and end dates if provided a negative frequency: ``` >>> start = cftime.DatetimeGregorian(2023, 10, 31) >>> end = cftime.DatetimeGregorian(2021, 11, 1) >>> xr.cftime_range(start, end, freq="-1YE") CFTimeIndex([2023-12-31 00:00:00, 2022-12-31 00:00:00, 2021-12-31 00:00:00], dtype='object', length=3, calendar='standard', freq='-1YE-DEC') ``` This PR ports a bug fix from pandas (https://github.com/pandas-dev/pandas/issues/56147) to prevent this from happening. The above example now produces: ``` >>> start = cftime.DatetimeGregorian(2023, 10, 31) >>> end = cftime.DatetimeGregorian(2021, 11, 1) >>> xr.cftime_range(start, end, freq="-1YE") CFTimeIndex([2022-12-31 00:00:00, 2021-12-31 00:00:00], dtype='object', length=2, calendar='standard', freq=None) ``` Since this is a bug fix, we do not make any attempt to preserve the old behavior if an earlier version of pandas is installed. In the testing context this means we skip some tests for pandas versions less than 3.0. - [x] User visible changes (including notable bug fixes) are documented in `whats-new.rst` 2024-05-04T14:48:08Z 2024-05-04T14:51:26Z     20c06e4c2916fb1a8732ab57b787f8e9c17975f9     0 a74c12d229310d05c339dc35fb211e3e4961af40 aaa778cffb89baaece31882e03a7f4af0adfe798 MEMBER   13221727 https://github.com/pydata/xarray/pull/8999  

Links from other tables

  • 1 row from pull_requests_id in labels_pull_requests
Powered by Datasette · Queries took 0.687ms