vasole / pymca

PyMca Toolkit git repository
Other
57 stars 51 forks source link

PyMcaEPDL97: deprecated numpy usage #1072

Closed woutdenolf closed 3 months ago

woutdenolf commented 3 months ago
import warnings
from PyMca5.PyMcaPhysics.xrf.PyMcaEPDL97 import getElementCrossSections

with warnings.catch_warnings():
    warnings.filterwarnings("error")
    getElementCrossSections("H", energy=0.3846, forced_shells=None)
DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/denolf/projects/ewoksfluo/testpymca.py", line 6, in <module>
    getElementCrossSections("H", energy=0.3846, forced_shells=None)
  File "/home/denolf/virtualenvs/ewoks/lib/python3.10/site-packages/PyMca5/PyMcaPhysics/xrf/PyMcaEPDL97.py", line 278, in getElementCrossSections
    ddict[key][i] = exp((log(y0) * log(x1/x) +\
vasole commented 3 months ago

1073 should close the reported issue, but I would not be surprised if the problem appears somewhere else...