Skip to content

Commit 044f5d7

Browse files
committed
another attempt to avoid problems encoding ndarrays
1 parent c748450 commit 044f5d7

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

larch/utils/jsonutils.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,8 @@ def encode4js(obj):
100100
return None
101101
if isinstance(obj, np.ndarray):
102102
try:
103-
name = repr(obj.dtype.name)
104103
out = {'__class__': 'Array', '__shape__': obj.shape,
105-
'__dtype__': name}
104+
'__dtype__': obj.dtype.name}
106105
except:
107106
print('error encoding ndarray: ', obj, obj.shape, obj.dtype)
108107
out = {'__class__': 'Array', '__shape__': obj.shape}

0 commit comments

Comments
 (0)