1111from virtualizarr import open_virtual_dataset
1212from virtualizarr .backend import FileType , automatically_determine_filetype
1313from virtualizarr .manifests import ManifestArray
14+ from virtualizarr .readers import HDF5VirtualBackend
1415from virtualizarr .readers .hdf import HDFVirtualBackend
1516from virtualizarr .tests import (
1617 has_astropy ,
@@ -83,7 +84,7 @@ def test_FileType():
8384
8485
8586@requires_kerchunk
86- @pytest .mark .parametrize ("hdf_backend" , [None , HDFVirtualBackend ])
87+ @pytest .mark .parametrize ("hdf_backend" , [HDF5VirtualBackend , HDFVirtualBackend ])
8788class TestOpenVirtualDatasetIndexes :
8889 def test_no_indexes (self , netcdf4_file , hdf_backend ):
8990 vds = open_virtual_dataset (netcdf4_file , indexes = {}, backend = hdf_backend )
@@ -115,7 +116,7 @@ def index_mappings_equal(indexes1: Mapping[str, Index], indexes2: Mapping[str, I
115116
116117
117118@requires_kerchunk
118- @pytest .mark .parametrize ("hdf_backend" , [None , HDFVirtualBackend ])
119+ @pytest .mark .parametrize ("hdf_backend" , [HDF5VirtualBackend , HDFVirtualBackend ])
119120def test_cftime_index (tmpdir , hdf_backend ):
120121 """Ensure a virtual dataset contains the same indexes as an Xarray dataset"""
121122 # Note: Test was created to debug: https://github.com/zarr-developers/VirtualiZarr/issues/168
@@ -145,7 +146,7 @@ def test_cftime_index(tmpdir, hdf_backend):
145146
146147
147148@requires_kerchunk
148- @pytest .mark .parametrize ("hdf_backend" , [None , HDFVirtualBackend ])
149+ @pytest .mark .parametrize ("hdf_backend" , [HDF5VirtualBackend , HDFVirtualBackend ])
149150class TestOpenVirtualDatasetAttrs :
150151 def test_drop_array_dimensions (self , netcdf4_file , hdf_backend ):
151152 # regression test for GH issue #150
@@ -172,14 +173,13 @@ class TestReadFromS3:
172173 @pytest .mark .parametrize (
173174 "indexes" , [None , {}], ids = ["None index" , "empty dict index" ]
174175 )
175- @pytest .mark .parametrize ("hdf_backend" , [None , HDFVirtualBackend ])
176- def test_anon_read_s3 (self , filetype , indexes , hdf_backend ):
176+ @pytest .mark .parametrize ("hdf_backend" , [HDF5VirtualBackend , HDFVirtualBackend ])
177+ def test_anon_read_s3 (self , indexes , hdf_backend ):
177178 """Parameterized tests for empty vs supplied indexes and filetypes."""
178179 # TODO: Switch away from this s3 url after minIO is implemented.
179180 fpath = "s3://carbonplan-share/virtualizarr/local.nc"
180181 vds = open_virtual_dataset (
181182 fpath ,
182- filetype = filetype ,
183183 indexes = indexes ,
184184 reader_options = {"storage_options" : {"anon" : True }},
185185 backend = hdf_backend ,
@@ -191,7 +191,7 @@ def test_anon_read_s3(self, filetype, indexes, hdf_backend):
191191
192192
193193@network
194- @pytest .mark .parametrize ("hdf_backend" , [None , HDFVirtualBackend ])
194+ @pytest .mark .parametrize ("hdf_backend" , [HDF5VirtualBackend , HDFVirtualBackend ])
195195class TestReadFromURL :
196196 @pytest .mark .parametrize (
197197 "filetype, url" ,
@@ -295,7 +295,7 @@ def test_virtualizarr_vs_local_nisar(self, hdf_backend):
295295
296296@requires_kerchunk
297297class TestLoadVirtualDataset :
298- @pytest .mark .parametrize ("hdf_backend" , [None , HDFVirtualBackend ])
298+ @pytest .mark .parametrize ("hdf_backend" , [HDF5VirtualBackend , HDFVirtualBackend ])
299299 def test_loadable_variables (self , netcdf4_file , hdf_backend ):
300300 vars_to_load = ["air" , "time" ]
301301 vds = open_virtual_dataset (
@@ -330,7 +330,7 @@ def test_explicit_filetype_and_backend(self, netcdf4_file):
330330 netcdf4_file , filetype = "hdf" , backend = HDFVirtualBackend
331331 )
332332
333- @pytest .mark .parametrize ("hdf_backend" , [None , HDFVirtualBackend ])
333+ @pytest .mark .parametrize ("hdf_backend" , [HDF5VirtualBackend , HDFVirtualBackend ])
334334 def test_group_kwarg (self , hdf5_groups_file , hdf_backend ):
335335 if hdf_backend :
336336 with pytest .raises (NotImplementedError , match = "Nested groups" ):
@@ -376,13 +376,13 @@ def test_open_virtual_dataset_passes_expected_args(
376376 }
377377 mock_read_kerchunk .assert_called_once_with (** args )
378378
379- @pytest .mark .parametrize ("hdf_backend" , [None , HDFVirtualBackend ])
379+ @pytest .mark .parametrize ("hdf_backend" , [HDF5VirtualBackend , HDFVirtualBackend ])
380380 def test_open_dataset_with_empty (self , hdf5_empty , tmpdir , hdf_backend ):
381381 vds = open_virtual_dataset (hdf5_empty , backend = hdf_backend )
382382 assert vds .empty .dims == ()
383383 assert vds .empty .attrs == {"empty" : "true" }
384384
385- @pytest .mark .parametrize ("hdf_backend" , [None , HDFVirtualBackend ])
385+ @pytest .mark .parametrize ("hdf_backend" , [HDF5VirtualBackend , HDFVirtualBackend ])
386386 def test_open_dataset_with_scalar (self , hdf5_scalar , tmpdir , hdf_backend ):
387387 vds = open_virtual_dataset (hdf5_scalar , backend = hdf_backend )
388388 assert vds .scalar .dims == ()
0 commit comments