Ejemplo n.º 1
0
 def test_h5netcdf_dask(self, ds1):
     ds = ds1.chunk()
     with tempfile.TemporaryDirectory() as tmpdir:
         save_ds(ds, os.path.join(tmpdir, "test.h5"), engine='h5netcdf')
         ds2 = load_ds(os.path.join(tmpdir, "test.h5"))
         assert ds1.identical(ds2)
         ds2.close()
Ejemplo n.º 2
0
 def test_h5netcdf_dask(self, ds1):
     ds = ds1.chunk()
     with tempfile.TemporaryDirectory() as tmpdir:
         save_ds(ds, os.path.join(tmpdir, "test.h5"), engine='h5netcdf')
         ds2 = load_ds(os.path.join(tmpdir, "test.h5"))
         assert ds1.identical(ds2)
         ds2.close()
Ejemplo n.º 3
0
 def test_io_only_real(self, ds_real, engine_save, engine_load):
     with tempfile.TemporaryDirectory() as tmpdir:
         save_ds(ds_real,
                 os.path.join(tmpdir, "test.h5"),
                 engine=engine_save)
         ds2 = load_ds(os.path.join(tmpdir, "test.h5"), engine=engine_load)
         assert ds_real.equals(ds2)
Ejemplo n.º 4
0
 def test_dask_load(self, ds_real, engine_load):
     with tempfile.TemporaryDirectory() as tmpdir:
         save_ds(ds_real, os.path.join(tmpdir, "test.nc"))
         ds2 = load_ds(os.path.join(tmpdir, "test.nc"),
                       engine=engine_load,
                       chunks=1)
         assert ds2.chunks['b'] == (1, 1)
         assert ds_real.identical(ds2)
         ds2.close()
Ejemplo n.º 5
0
 def test_dask_load(self, ds_real, engine_load):
     with tempfile.TemporaryDirectory() as tmpdir:
         save_ds(ds_real, os.path.join(tmpdir, "test.nc"))
         ds2 = load_ds(os.path.join(tmpdir, "test.nc"),
                       engine=engine_load,
                       chunks=1)
         assert ds2.chunks['b'] == (1, 1)
         assert ds_real.identical(ds2)
         ds2.close()
Ejemplo n.º 6
0
 def test_io_complex_data(self, ds1, engine_save, engine_load):
     with tempfile.TemporaryDirectory() as tmpdir:
         save_ds(ds1, os.path.join(tmpdir, "test.h5"), engine=engine_save)
         ds2 = load_ds(os.path.join(tmpdir, "test.h5"), engine=engine_load)
         assert ds1.identical(ds2)
Ejemplo n.º 7
0
 def test_io_only_real(self, ds_real, engine_save, engine_load):
     with tempfile.TemporaryDirectory() as tmpdir:
         save_ds(ds_real, os.path.join(tmpdir, "test.h5"),
                 engine=engine_save)
         ds2 = load_ds(os.path.join(tmpdir, "test.h5"), engine=engine_load)
         assert ds_real.equals(ds2)
Ejemplo n.º 8
0
 def test_io_complex_data(self, ds1, engine_save, engine_load):
     with tempfile.TemporaryDirectory() as tmpdir:
         save_ds(ds1, os.path.join(tmpdir, "test.h5"), engine=engine_save)
         ds2 = load_ds(os.path.join(tmpdir, "test.h5"), engine=engine_load)
         assert ds1.identical(ds2)