Skip to content

Commit 47eb62f

Browse files
sharkinsspatialSean Harkins
andauthored
Apply typing simplification changes from #512 to hdf filters. (#520)
Co-authored-by: Sean Harkins <[email protected]>
1 parent adc7f01 commit 47eb62f

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

virtualizarr/readers/hdf/filters.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
import dataclasses
24
from typing import TYPE_CHECKING, List, Tuple, TypedDict, Union
35

@@ -9,17 +11,12 @@
911

1012
from virtualizarr.utils import soft_import
1113

14+
h5py = soft_import("h5py", "For reading hdf files", strict=False)
15+
16+
1217
if TYPE_CHECKING:
13-
import h5py # type: ignore
14-
from h5py import Dataset, Group # type: ignore
18+
from h5py import Dataset
1519

16-
h5py = soft_import("h5py", "For reading hdf files", strict=False)
17-
if h5py:
18-
Dataset = h5py.Dataset
19-
Group = h5py.Group
20-
else:
21-
Dataset = dict()
22-
Group = dict()
2320

2421
hdf5plugin = soft_import(
2522
"hdf5plugin", "For reading hdf files with filters", strict=False
@@ -28,7 +25,6 @@
2825
"imagecodecs", "For reading hdf files with filters", strict=False
2926
)
3027

31-
3228
_non_standard_filters = {
3329
"gzip": "zlib",
3430
"lzf": "imagecodecs_lzf",

0 commit comments

Comments
 (0)