I am attempting to use Xarray's open_mfdataset() function to open a large number of spatiotemporal files. However, some levels of the hierarchy have different numbers of files even though they result in the same dimensions.
Imagine the file structure that I want to process looks like this:
[
[r1_2000_2050.nc, r1_2050_2100.nc],
[r2_2000_2025.nc, r2_2025_2050.nc, r2_2050_2100.nc]
]
All of the dimensions do match, the spatial dimensions are the same and though the second sublist has more files, the temporal dimensions still run from 2000-2100. I have confirmed that I can combine these files through a manual series of xarray merges and concats but I want to take advantage of open_mfdataset's parallel loading and chunking structure so that I don't load everything into memory.
When I try to load this structure with:
xr.open_mfdataset(nested_paths, combine='nested', concat_dim=['realization', 'time'])
I get this error:
ValueError: The supplied objects do not form a hypercube because sub-lists do not have consistent lengths along dimension0
If this is possible to do with xarray, that would be extremely beneficial.