Skip to content

Commit eb2d618

Browse files
committed
fix read-only error when decoding ND array as numpy array, fix #4
1 parent e874adc commit eb2d618

4 files changed

Lines changed: 5 additions & 5 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
- Copyright: (C) Qianqian Fang (2019-2022) <q.fang at neu.edu>
66
- License: Apache License, Version 2.0
7-
- Version: 0.5.1
7+
- Version: 0.5.2
88
- URL: https://github.com/NeuroJSON/pyjdata
99

1010
[![Build Status](https://travis-ci.com/fangq/pyjdata.svg?branch=master)](https://travis-ci.com/fangq/pyjdata)

jdata/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
from .jfile import load, save, show, loadt, savet, loadb, saveb, jext
3737
from .jdata import encode, decode, jdtype, jsonfilter
3838

39-
__version__ = "0.5.1"
39+
__version__ = "0.5.2"
4040
__all__ = [
4141
"load",
4242
"save",

jdata/jdata.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ def decode(d, opt={}):
267267
except Exception:
268268
print('Warning: you must install "blosc2" module to decompress a data record in this file, ignoring')
269269
return copy.deepcopy(d) if opt["inplace"] else d
270-
newobj = np.frombuffer(newobj, dtype=np.dtype(d["_ArrayType_"])).reshape(d["_ArrayZipSize_"])
270+
newobj = np.frombuffer(bytearray(newobj), dtype=np.dtype(d["_ArrayType_"])).reshape(d["_ArrayZipSize_"])
271271
if "_ArrayIsComplex_" in d and newobj.shape[0] == 2:
272272
newobj = newobj[0] + 1j * newobj[1]
273273
if "_ArrayOrder_" in d and (

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
setup(
77
name = 'jdata',
88
packages = ['jdata'],
9-
version = '0.5.1',
9+
version = '0.5.2',
1010
license='Apache license 2.0',
1111
description = 'Encoding and decoding Python data structrues using portable JData-annotated formats',
1212
long_description=readme,
@@ -15,7 +15,7 @@
1515
author_email = 'fangqq@gmail.com',
1616
maintainer= 'Qianqian Fang',
1717
url = 'https://github.com/NeuroJSON/pyjdata',
18-
download_url = 'https://github.com/NeuroJSON/pyjdata/archive/v0.5.1.tar.gz',
18+
download_url = 'https://github.com/NeuroJSON/pyjdata/archive/v0.5.2.tar.gz',
1919
keywords = ['JSON', 'JData', 'UBJSON', 'BJData', 'OpenJData', 'NeuroJSON', 'JNIfTI', 'JMesh', 'Encoder', 'Decoder'],
2020
platforms="any",
2121
install_requires=[

0 commit comments

Comments
 (0)