Closed mayeshh closed 4 years ago
I'm using numpy version 1.17.2, and am getting an error when loading .sm files:
d = loader.usalex(fname=fname)
resulting error:
--------------------------------------------------------------------------- ValueError Traceback (most recent call last) <ipython-input-9-e1248430f5f7> in <module> ----> 1 d = loader.usalex(fname=fnames[1]) ~/software/FRETBursts/fretbursts/loader.py in usalex(fname, leakage, gamma, header, BT) 427 ' The header length is now computed automatically.') 428 print(" - Loading '%s' ... " % fname) --> 429 ph_times_t, det_t, labels = load_sm(fname, return_labels=True) 430 print(" [DONE]\n") 431 ~/anaconda3/envs/py37-fb/lib/python3.7/site-packages/phconvert/smreader.py in load_sm(fname, return_labels) 122 123 # Swap byte order inplace to little endian --> 124 data.setflags(write=True) 125 data = data.byteswap(True).newbyteorder() 126 ValueError: cannot set WRITEABLE flag to True of this array```
I have tried changing the code to make sm_dtype
little endian:
sm_dtype = np.dtype([('timestamp', '<i8'), ('detector', '<u4')])
and commented out the following lines:
data.setflags(write=True) data = data.byteswap(True).newbyteorder()```
This raises the ValueError: output array is read-only
error later in my notebook when I try to assign detector specs to the data object using d.add
I want to submit a PR, but so far I have not figured out how to make the array writable.
... apparently I had two versions of phconvert
. The newest one, forked and cloned locally, does not give this error. Closing this issue.
I'm using numpy version 1.17.2, and am getting an error when loading .sm files:
d = loader.usalex(fname=fname)
resulting error: