____________________________ test_from_shapely_arr _____________________________
@mock.patch("pygeos.io.ShapelyGeometry", ShapelyGeometryMock)
@mock.patch("pygeos.io.shapely_geos_version", pygeos.geos_capi_version_string)
def test_from_shapely_arr():
> actual = pygeos.from_shapely([ShapelyGeometryMock(point), None])
pygeos/test/test_io.py:341:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pygeos/io.py:243: in from_shapely
arr = np.asarray(geometry, dtype=object)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
a = [<pygeos.test.test_io.ShapelyGeometryMock object at 0x7f65862e0190>, None]
dtype = <class 'object'>, order = None
@set_array_function_like_doc
@set_module('numpy')
def asarray(a, dtype=None, order=None, *, like=None):
"""
....
"""
if like is not None:
return _asarray_with_like(a, dtype=dtype, order=order, like=like)
> return array(a, dtype, copy=False, order=order)
E ValueError: Invalid __array_interface__ value, must be a dict
See eg https://github.com/pygeos/pygeos/runs/1519984556
This
ShapelyGeometryMockis defined aspygeos/pygeos/test/test_io.py
Lines 23 to 30 in 211fc48
but so apparently numpy now calls the
__array_interface__on individual objects in a list innp.asarray(..).