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

MFDataset not support NETCDF4 #1240

Open
legend0000 opened this issue Mar 14, 2023 · 7 comments
Open

MFDataset not support NETCDF4 #1240

legend0000 opened this issue Mar 14, 2023 · 7 comments

Comments

@legend0000
Copy link

image

@jswhit
Copy link
Collaborator

jswhit commented Mar 15, 2023

probably better to use xarray.mf_dataset anyway

@jswhit
Copy link
Collaborator

jswhit commented Mar 15, 2023

MFDataset really only requires the classic data model, so we could remove the check for the file format. The problem will be if NETCDF4 files are used that don't use the classic data model it may fail.

@legend0000
Copy link
Author

legend0000 commented Mar 17, 2023 via email

@jswhit
Copy link
Collaborator

jswhit commented Mar 18, 2023

I think we understood your meaning - xarray.mf_dataset has better functionality than netCDF4.MFDataset. xarray uses netCDF4 under the hood for netCDF file I/O.

@ChrisBarker-NOAA
Copy link
Contributor

xarray does a lot that can be useful. Nonetheless, using the netCDF4 lib directly has a lot of use cases.

We are bitten a lot by this limitation -- netcdf4 is no longer rare, and is the default in most cases -- it seems we could remove this limitation pretty easily (at least for "classic" files -- and even for non-classic, probably be a bit smart about it :-)

Would a PR be accepted?

-CHB

@ChrisBarker-NOAA
Copy link
Contributor

NOTE:

" if NETCDF4 files are used that don't use the classic data model it may fail."

what would cause it to fail? one thing I can think of is more than one unlimited dimension -- any others?

groups would be problematic, too.

But I think the code could check for the actual feature(s) that matter, rather than the file format, yes.

e.g. we commonly get a bunch o' netcdf4 files that we can't use with MFDAtaset, but we can simply convert them to netcdf3, and it all works -- so file format is not really the issue here, it's actual data layout and features..

or am I missing something?

@ChrisBarker-NOAA
Copy link
Contributor

Ping! I'm happy to work on a PR -- but only if someone can tell me it has a chance of being accepted ....

@jswhit What do you think?

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

No branches or pull requests

3 participants