scipy: BUG: `eval_hermite` is incompatible with NumPy 2.0 on Windows
Describe your issue.
python -c "import scipy.special, numpy as np;print(scipy.special.eval_hermite(np.arange(2), np.zeros((1,2), dtype=int)))"
Traceback (most recent call last):
File "<string>", line 1, in <module>
TypeError: ufunc 'eval_hermite' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''
One can create a GitHub Actions workflow to validate:
name: Test
on:
push:
jobs:
test:
name: test scipy
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- run: pip install scipy
- run: python -c "import scipy.special, numpy as np;print(scipy.special.eval_hermite(np.arange(2), np.zeros((1,2), dtype=int)))"
Reproducing Code Example
import scipy.special, numpy as np
print(scipy.special.eval_hermite(np.arange(2), np.zeros((1,2), dtype=int)))
Error message
TypeError: ufunc 'eval_hermite' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''
SciPy/NumPy/Python version and system information
scipy 1.14.0
numpy 2.0.0
python 3.12.4
Microsoft Windows Server 2022
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 1
- Comments: 19 (19 by maintainers)
Update: Of the functions tested in the
test_cython_apiinspecial/tests/test_cython_special.py,eval_hermiteandeval_hermitenormare the only ones where the only type defined for a certain input islong. All the other ufuncs withintorlonginputs also handledoublefor the same input, so when they are given a 64 bit integer type on a platform wherelongis 32 bit, the input is cast todouble.