Closed pllim closed 3 months ago
From @mcara
The problems appear to be due to import failure of math_util even though math_util...so is built. very strange. If this import fails, the code fallback to the Python code. Probably that code is buggy too and hence the errors. So, two things need to be fixed: Python code and import of the compiled C module build with numpy 2.0.
Here is what I get when I import math_util
:
$ uname -s -m
Darwin arm64
/*
* Finds the length of the given great circle arc AB
*/
static void
DOUBLE_length([...])
{
printf("DEFINITELY C CODE\n");
// [...]
}
pip install -e .
>>> import numpy as np
>>> from spherical_geometry import math_util
>>> from spherical_geometry import great_circle_arc
>>> great_circle_arc.HAS_C_UFUNCS
True
>>> math_util.length([[np.nan, 0, 0]], [[0, 0, np.inf]])
DEFINITELY C CODE
<stdin>:1: RuntimeWarning: invalid value encountered in length
array([0.])
>>> math_util.__file__
'[redacted]/spherical_geometry/math_util.cpython-311-darwin.so'
Mihai fixed it. Mihai is a good man.
Example log: https://github.com/spacetelescope/spherical_geometry/actions/runs/8823443975/job/24223897028
I wanted to blame https://github.com/scipy/scipy/issues/20531 but I don't think I can since scipy is not even installed.