This is a permanent fix for a deprecation warning that occurred in the unit tests. Conversion of an array to a scalar is deprecated in NumPy 1.25. In the function sample_temperature in the intensity correction algorithms, we attempted to convert a one-dimensional array into a float. This triggers now the deprecation warning. The solution is to first check for lists and arrays before attempting to convert a single value to a float.
To test:
Load MAR21335_Ei60meV dataset
Display slice
On the intensity dropdown select Chi''(Q,E)
Enter 80 in combo box and click ok
On the intensity dropdown select GDOS
There should be no pop up window asking for the sample temperature
Description of work:
This is a permanent fix for a deprecation warning that occurred in the unit tests. Conversion of an array to a scalar is deprecated in NumPy 1.25. In the function sample_temperature in the intensity correction algorithms, we attempted to convert a one-dimensional array into a float. This triggers now the deprecation warning. The solution is to first check for lists and arrays before attempting to convert a single value to a float.
To test:
MAR21335_Ei60meV
datasetChi''(Q,E)
80
in combo box and click okGDOS
Also, check that the unit tests were running without failure for this branch: https://github.com/mantidproject/mslice/actions/runs/8047878035
Fixes #975.