def open_ds(self): from yt.utilities.on_demand_imports import _netCDF4 as netCDF4 ds = netCDF4.Dataset(self.filename) yield ds ds.close()
def open_ds(self, **kwargs): from yt.utilities.on_demand_imports import _netCDF4 as netCDF4 ds = netCDF4.Dataset(self.filename, mode="r", **kwargs) yield ds ds.close()