Skip to content

using chunks='auto' inside open_mfdataset call with a cftime coordinate #6332

Answered by spencerkclark
tlsw231 asked this question in Q&A
Discussion options

You must be logged in to vote

I think this suggests you have at least one data variable that contains cftime.datetime objects in your Dataset (likely in addition to a time coordinate, which will automatically be loaded into memory and not have this issue). A couple options would be:

  1. Drop these data variables within your open_mfdataset call (if you don't need them and you know their names):
ds = xr.open_mfdataset(..., chunks="auto", drop_variables=["time_data_var1", "time_data_var2"])
  1. Or hold off on decoding the times until after you open the dataset:
ds = xr.open_mfdataset(..., chunks="auto", decode_cf=False)
ds = xr.decode_cf(ds)

This gets a little more complicated if the times in your multi-file dataset are enco…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@tlsw231
Comment options

Answer selected by tlsw231
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants