mantidproject / mslice

Source code for Mantid MSlice
http://mantidproject.github.io/mslice
1 stars 1 forks source link

Permanent fix for deprecation warning #977

Closed SilkeSchomann closed 5 months ago

SilkeSchomann commented 5 months ago

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:

Fixes #975.