home / github / pull_requests

Menu
  • GraphQL API
  • Search all tables

pull_requests: 104726723

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
104726723 MDExOlB1bGxSZXF1ZXN0MTA0NzI2NzIz 1252 closed 0 CFTimeIndex 6628425 - [x] closes #1084 - [x] passes ``git diff upstream/master | flake8 --diff`` - [x] tests added / passed - [x] whatsnew entry This work in progress PR is a start on implementing a ```NetCDFTimeIndex```, a subclass of pandas.Index, which closely mimics pandas.DatetimeIndex, but uses ```netcdftime._netcdftime.datetime``` objects. Currently implemented in the new index are: - Partial datetime-string indexing (using strictly [ISO8601-format strings](https://en.wikipedia.org/wiki/ISO_8601), using a date parser implemented by @shoyer in https://github.com/pydata/xarray/issues/1084#issuecomment-274372547) - Field-accessors for year, month, day, hour, minute, second, and microsecond, to enable ```groupby``` operations on attributes of date objects This index is meant as a step towards improving the handling of non-standard calendars and dates outside the range ```Timestamp('1677-09-21 00:12:43.145225')``` to ```Timestamp('2262-04-11 23:47:16.854775807')```. -------------- For now I have pushed only the code and some tests for the new index; I want to make sure the index is solid and well-tested before we consider integrating it into any of xarray's existing logic or writing any documentation. Regarding the index, there are a couple remaining outstanding issues (that at least I'm aware of): 1. Currently one can create non-sensical datetimes using ```netcdftime._netcdftime.datetime``` objects. This means one can attempt to index with an out-of-bounds string or datetime without raising an error. Could this possibly be addressed upstream? For example: ``` In [1]: from netcdftime import DatetimeNoLeap In [2]: DatetimeNoLeap(2000, 45, 45) Out[2]: netcdftime._netcdftime.DatetimeNoLeap(2000, 45, 45, 0, 0, 0, 0, -1, 1) ``` 2. I am looking to enable this index to be used in pandas.Series and pandas.DataFrame objects as well; this requires implementing a ```get_value``` method. I have taken @shoyer's suggested simplified approach from https://github.com/pydata/xarray/issues/1084#issuecomment-275963433, and tweaked it to also allow for slice indexing, so I think this is most of the way there. A remaining to-do for me, however, is to implement something to allow for integer-indexing outside of ```iloc```, e.g. if you have a pandas.Series ```series```, indexing with the syntax ```series[1]``` or ```series[1:3]```. Hopefully this is a decent start; in particular I'm not an expert in writing tests so please let me know if there are improvements I can make to the structure and / or style I've used so far. I'm happy to make changes. I appreciate your help. 2017-02-06T02:10:47Z 2019-02-18T20:54:03Z 2018-05-13T05:19:11Z 2018-05-13T05:19:10Z ebe0dd03187a5c3138ea12ca4beb13643679fe21     0 c318755b51c5dab4008a6f48d0afdc80bbd6bea6 39bd2076e87090ef3130f55f472f3138abad3558 MEMBER   13221727 https://github.com/pydata/xarray/pull/1252  

Links from other tables

  • 2 rows from pull_requests_id in labels_pull_requests
Powered by Datasette · Queries took 0.676ms