Skip to content

Incompatibility with new shapely major version #831

Closed
equinor/webviz-subsurface
#1261
@anders-kiaer

Description

@anders-kiaer

I think this issue belongs in xtgeo. Downstream we see an issue if we don't restrict what version of shapely pip pulls down. Using the new version 2.0 we see this in CI:

  File "/opt/hostedtoolcache/Python/3.9.16/x64/lib/python3.9/site-packages/xtgeo/xyz/polygons.py", line 750, in get_fence
    return _xyz_oper.get_fence(
  File "/opt/hostedtoolcache/Python/3.9.16/x64/lib/python3.9/site-packages/xtgeo/xyz/_xyz_oper.py", line 250, in get_fence
    hxlen = fence.get_shapely_objects()[0].length
  File "/opt/hostedtoolcache/Python/3.9.16/x64/lib/python3.9/site-packages/xtgeo/xyz/polygons.py", line 605, in get_shapely_objects
    spoly = sg.LineString(np.stack([pxcor, pycor, pzcor], axis=1))
  File "/opt/hostedtoolcache/Python/3.9.16/x64/lib/python3.9/site-packages/shapely/geometry/linestring.py", line 73, in __new__
    geom = shapely.linestrings(coordinates)
  File "/opt/hostedtoolcache/Python/3.9.16/x64/lib/python3.9/site-packages/shapely/decorators.py", line 77, in wrapped
    return func(*args, **kwargs)
  File "/opt/hostedtoolcache/Python/3.9.16/x64/lib/python3.9/site-packages/shapely/creation.py", line 120, in linestrings
    return lib.linestrings(coords, out=out, **kwargs)
TypeError: ufunc 'linestrings' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingquestionFurther information is requested

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions