-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path__init__.py
More file actions
36 lines (27 loc) · 868 Bytes
/
__init__.py
File metadata and controls
36 lines (27 loc) · 868 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import importlib.metadata
import importlib.util
import numcodecs
from packaging.version import parse
from wavpack_numcodecs.wavpack import wavpack_version
HAVE_ZARR = importlib.util.find_spec("zarr") is not None
USE_ZARR_V3 = False
if HAVE_ZARR:
import zarr
if parse(zarr.__version__) >= parse("3.0.0"):
USE_ZARR_V3 = True
if USE_ZARR_V3:
from zarr.registry import register_codec
from wavpack_numcodecs.wavpackv3 import WavPack
else:
from numcodecs import register_codec
from wavpack_numcodecs.wavpack import WavPack
register_codec("wavpack", WavPack)
from .globals import (
get_num_decoding_threads,
get_num_encoding_threads,
reset_num_decoding_threads,
reset_num_encoding_threads,
set_num_decoding_threads,
set_num_encoding_threads,
)
__version__ = importlib.metadata.version("wavpack_numcodecs")