Skip to content

Conversation

jbusecke
Copy link
Collaborator

@jbusecke jbusecke commented Sep 22, 2025

I have started an implementation here by simply following through the code and adding decode_timedelta wherever decode_times was passed along.

I noticed that the type hints only allowed for bool|None previously, but xarray allows passing CFTime/TimedeltaCoder and per variable mappings. I have added these here to all relevant functions for now, but can revert this if I am missing the point of it only being bool|None.

It seems that I will have to dig a bit deeper into the typing to make this pass, but before I venture that route it would be great to have a chat about this.

What I am missing here are additional tests. I might need a bit of help/input to make sense of what exactly we should test here.

@jbusecke jbusecke changed the title Add decode_timedelta argument to open_virtual_dataset WIP: Add decode_timedelta argument to open_virtual_dataset Sep 22, 2025
@maxrjones
Copy link
Member

@jbusecke I think that the more limited typing in VirtualiZarr is just due to the function pre-dating the new typing in Xarray (added in pydata/xarray#9901). I recommend using the newer typing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to provide decode_timedelta to open_virtual_dataset

2 participants