Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def netcdf4_file_with_data_in_multiple_groups(tmp_path: Path) -> str:


@pytest.fixture
def netcdf4_files_factory(tmp_path: Path) -> Callable:
def netcdf4_files_factory(tmp_path: Path) -> Callable[[], tuple[str, str]]:
def create_netcdf4_files(
encoding: Optional[Mapping[str, Mapping[str, Any]]] = None,
) -> tuple[str, str]:
Expand Down Expand Up @@ -96,7 +96,8 @@ def netcdf4_file_with_2d_coords(tmp_path: Path) -> str:
def netcdf4_virtual_dataset(netcdf4_file):
from virtualizarr import open_virtual_dataset

return open_virtual_dataset(netcdf4_file, indexes={})
with open_virtual_dataset(netcdf4_file, indexes={}) as ds:
yield ds


@pytest.fixture
Expand Down
6 changes: 3 additions & 3 deletions virtualizarr/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ def open_virtual_dataset(
cftime_variables: Iterable[str] | None = None,
indexes: Mapping[str, Index] | None = None,
virtual_array_class=ManifestArray,
virtual_backend_kwargs: Optional[dict] = None,
reader_options: Optional[dict] = None,
backend: Optional[VirtualBackend] = None,
virtual_backend_kwargs: dict | None = None,
reader_options: dict | None = None,
backend: type[VirtualBackend] | None = None,
) -> Dataset:
"""
Open a file or store as an xarray Dataset wrapping virtualized zarr arrays.
Expand Down
Loading