Skip to content
This repository has been archived by the owner on Dec 11, 2023. It is now read-only.

Commit

Permalink
Update carray_ext.pyx
Browse files Browse the repository at this point in the history
  • Loading branch information
kaybinwong committed Apr 2, 2021
1 parent 500351d commit 97a427c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion bcolz/carray_ext.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1378,7 +1378,13 @@ cdef class carray:
storagef = os.path.join(metadir, STORAGE_FILE)
with open(storagef, 'rb') as storagefh:
data = json.loads(storagefh.read().decode('ascii'))
dtype_ = np.dtype(data["dtype"])
# dtype_ = np.dtype(data["dtype"])
if data["dtype"][0] == "[" and data["dtype"][-1] == "]":
# read numpy array
import ast
dtype_ = np.dtype(ast.literal_eval(data["dtype"]))
else:
dtype_ = np.dtype(data["dtype"])
chunklen = data["chunklen"]
cparams = data["cparams"]
cname = cparams['cname'] if 'cname' in cparams else 'blosclz'
Expand Down

0 comments on commit 97a427c

Please sign in to comment.