Skip to content

Commit 1f29522

Browse files
committed
Gather optional dependencies
1 parent 7d0083d commit 1f29522

File tree

1 file changed

+16
-18
lines changed

1 file changed

+16
-18
lines changed

numcodecs/__init__.py

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,6 @@
6363

6464
register_codec(LZ4)
6565

66-
# zfpy is an optional external dependency
67-
with suppress(ImportError):
68-
from numcodecs.zfpy import ZFPY
69-
70-
register_codec(ZFPY)
71-
7266
from numcodecs.astype import AsType
7367

7468
register_codec(AsType)
@@ -109,23 +103,12 @@
109103

110104
register_codec(BitRound)
111105

112-
# msgpack is an optional external dependency
113-
with suppress(ImportError):
114-
from numcodecs.msgpacks import MsgPack
115-
116-
register_codec(MsgPack)
117-
118106
from numcodecs.checksum32 import CRC32, Adler32, JenkinsLookup3
119107

120108
register_codec(CRC32)
121109
register_codec(Adler32)
122110
register_codec(JenkinsLookup3)
123111

124-
with suppress(ImportError):
125-
from numcodecs.checksum32 import CRC32C
126-
127-
register_codec(CRC32C)
128-
129112
from numcodecs.json import JSON
130113

131114
register_codec(JSON)
@@ -141,7 +124,22 @@
141124

142125
register_codec(Fletcher32)
143126

144-
# pcodec is an optional external dependency
127+
# Optional depenedencies
128+
with suppress(ImportError):
129+
from numcodecs.zfpy import ZFPY
130+
131+
register_codec(ZFPY)
132+
133+
with suppress(ImportError):
134+
from numcodecs.msgpacks import MsgPack
135+
136+
register_codec(MsgPack)
137+
138+
with suppress(ImportError):
139+
from numcodecs.checksum32 import CRC32C
140+
141+
register_codec(CRC32C)
142+
145143
with suppress(ImportError):
146144
from numcodecs.pcodec import PCodec
147145

0 commit comments

Comments
 (0)