Code Sample, a minimal, complete, and verifiable piece of code
from datetime import datetime
from pyorbital.orbital import get_observer_look
print(get_observer_look(0, 0, 30_000_000, datetime.now(), 0, 0, 0))
Problem description
The code sample raises an IndexError in my Python 3.10 environment with numpy 1.21.4. It returns successfully in my Python 3.9 environment with numpy 1.20.3. It also fails in this GitHub CI environment with Python 3.8 and numpy 1.21.4.
Expected Output
With Python 3.9, numpy 1.20.3 I get:
(180.0, 89.99999914622636)
Actual Result, Traceback if applicable
With Python 3.10, numpy 1.20.3 I get:
/data/gholl/mambaforge/envs/py310/lib/python3.10/site-packages/pyorbital/orbital.py:129: RuntimeWarning: divide by zero encountered in double_scalars
az_ = np.arctan(-top_e / top_s)
Traceback (most recent call last):
File "/home/gholl/checkouts/protocode/mwe/get-observer-look-indexerror.py", line 3, in <module>
print(get_observer_look(0, 0, 30_000_000, datetime.now(), 0, 0, 0))
File "/data/gholl/mambaforge/envs/py310/lib/python3.10/site-packages/pyorbital/orbital.py", line 140, in get_observer_look
az_data[np.where(top_s > 0)] += np.pi
IndexError: invalid index to scalar variable.
Versions of Python, package at hand and relevant dependencies
pyorbital v1.6.1-58-gcbe67e2
Python 3.10, numpy 1.21.4: fails (no older numpy provided for Python 3.10)
Python 3.9, numpy 1.20.3: passes (no newer numpy provided with mamba update numpy)
Code Sample, a minimal, complete, and verifiable piece of code
Problem description
The code sample raises an
IndexError
in my Python 3.10 environment with numpy 1.21.4. It returns successfully in my Python 3.9 environment with numpy 1.20.3. It also fails in this GitHub CI environment with Python 3.8 and numpy 1.21.4.Expected Output
With Python 3.9, numpy 1.20.3 I get:
Actual Result, Traceback if applicable
With Python 3.10, numpy 1.20.3 I get:
Versions of Python, package at hand and relevant dependencies
mamba update numpy
)