3

The default backend engine for xarray is set to netcdf4 in this function

What is the best way to make h5netcdf the default engine in xarray?

Ted Habermann
  • 321
  • 2
  • 9
  • I don't think it is possible to directly set the default engine. Does setting the `engine` key word argument in your `open_dataset` and `to_netcdf` calls not work for some reason? – jhamman Oct 31 '17 at 17:50

1 Answers1

4

This isn't currently possible, but we would welcome a pull request to add such as an option via the xarray.set_options() interface.

shoyer
  • 9,165
  • 1
  • 37
  • 55
  • This seems like a natural step forward given the shared authorship of xarray and h5netcdf. Is there a reason that it has not happened already? Am I missing something? – Ted Habermann Nov 01 '17 at 01:11
  • @TedHabermann - I think it just hasn't come up yet. Xarray development began before h5netcdf so the legacy default is and will probably remain `netcdf4-python` for a while. – jhamman Nov 01 '17 at 03:45
  • It does probably makes sense to make h5netcdf the default engine for writing a netCDF4 file if netCDF4-Python is not installed. But yes, we didn't do this at first because h5netcdf was new and experimental (and it still is, to some extent). – shoyer Nov 01 '17 at 15:00