MCPcopy Create free account
hub / github.com/casperdcl/brainweb / gunzip_array

Function gunzip_array

brainweb/utils.py:198–205  ·  view source on GitHub ↗

Uncompress the specified file and read the binary output as an array.

(fpath, shape=None, dtype=None)

Source from the content-addressed store, hash-verified

196
197
198def gunzip_array(fpath, shape=None, dtype=None):
199 """
200 Uncompress the specified file and read the binary output as an array.
201 """
202 with gzip.open(fpath) as fi:
203 data = np.frombuffer(fi.read(), dtype=dtype)
204 if shape is not None:
205 return data.reshape(shape)
206
207
208load_file = functools.partial(

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected