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

Allow multiple date formats when using sel on GRIB data #253

Open
sandorkertesz opened this issue Nov 8, 2023 · 0 comments
Open

Allow multiple date formats when using sel on GRIB data #253

sandorkertesz opened this issue Nov 8, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@sandorkertesz
Copy link
Collaborator

sandorkertesz commented Nov 8, 2023

If ds is a GRIB filedlist, using sel() for the date key only works when it is specified as an int:

ds.sel(date=20230510)

However, ideally e.g. these should also work:

ds.sel(date="20230510")
ds.sel(date="2023-05-10")
ds.sel(date=np.datetime64("2023-05-10"))
ds.sel(date=datetime.datetime(2023,5,10))
...

Similarly, we should be able to specify datetime.timedelta or np.timedelta64 for "step":

ds.sel(step=datetime.timedelta(hours=6))
ds.sel(step=datetime.timedelta(hours=6, minutes=15))
ds.sel(step=np.timedelta64(6, 'h'))
...
@sandorkertesz sandorkertesz added the enhancement New feature or request label Nov 8, 2023
@sandorkertesz sandorkertesz changed the title Support multiple date formats wehn using sel on GRIB data Allow multiple date formats when using sel on GRIB data Nov 8, 2023
@sandorkertesz sandorkertesz self-assigned this Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant