You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
data = numpy.zeros(100)
>>> data[:] is data
False
>>> data[:].flags
C_CONTIGUOUS : True
F_CONTIGUOUS : True
OWNDATA : False
WRITEABLE : True
ALIGNED : True
WRITEBACKIFCOPY : False
UPDATEIFCOPY : False
>>> flumpy.from_numpy(data)
<scitbx_array_family_flex_ext.double object at 0x7f50b463da50>
>>> flumpy.from_numpy(data[:])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'numpy.ndarray' object has no attribute 'obj'
This is because it assumes that if array.base exists, it is pointing to a memoryview object (e.g. something you previously converted). This isn't the case for standard slices of numpy arrays.
The text was updated successfully, but these errors were encountered:
This could happen in cases where you are converting e.g. a contiguous slice of
your original array - flumpy previously needlessly assumed that if an array
didn't own it's own data, that the array base came from flex.
Fixescctbx#406
This could happen in cases where you are converting e.g. a contiguous slice of
your original array - flumpy previously needlessly assumed that if an array
didn't own it's own data, that the array base came from flex.
Fixes#406.
This is because it assumes that if
array.base
exists, it is pointing to amemoryview
object (e.g. something you previously converted). This isn't the case for standard slices of numpy arrays.The text was updated successfully, but these errors were encountered: