spacetelescope / spherical_geometry

A Python package for handling spherical polygons that represent arbitrary regions of the sky
http://spherical-geometry.readthedocs.io/
62 stars 31 forks source link

Fix segfault with numpy 1.22 #216

Closed mcara closed 2 years ago

mcara commented 2 years ago

It has been reported, see, i.e., https://github.com/spacetelescope/jwst/issues/6539, that spherical_geometry was causing a segmentation fault on import when used with numpy==1.22.

This PR fixes this issue which was caused by incorrect number of ntypes (2) being passed to the PyUFunc_FromFuncAndDataAndSignature function when only one (1) type is actually supported.

Fixes https://github.com/spacetelescope/jwst/issues/6539

codecov[bot] commented 2 years ago

Codecov Report

Merging #216 (0579746) into master (c5f581e) will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #216   +/-   ##
=======================================
  Coverage   64.99%   64.99%           
=======================================
  Files           8        8           
  Lines        1254     1254           
=======================================
  Hits          815      815           
  Misses        439      439           

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update c5f581e...0579746. Read the comment docs.

mcara commented 2 years ago

I'm surprised it worked before.

Same

pllim commented 2 years ago

Looks like you need another release. 😬

mcara commented 2 years ago

Even though this PR was closed, @perrygreenfield @WilliamJamieson @nden, please feel free to comment here if you have other improvements or if it does not fixes the issue.

Thanks!

perrygreenfield commented 2 years ago

Mihai has ably shouldered the heavy weight of spherical support, much like...Atlas.

WilliamJamieson commented 2 years ago

It does appear to fix the segfault when testing jwst with numpy 1.22.

pllim commented 2 years ago

Maybe Atlas will get a promotion! 😉

mcara commented 2 years ago

I am trying to convince Heracles to be a maintainer for 1 day.