reflectivity / orsopy

http://www.reflectometry.org/orsopy/
MIT License
0 stars 8 forks source link

Convert numpy scalars to native python objects before sending to yaml dump #101

Closed nvaytet closed 1 year ago

nvaytet commented 1 year ago

This came up when trying to save values from Scipp variables to an Orso file. In recent versions of Scipp, var.value() now returns numpy types, e.g. np.float64 instead ofpython float. We use the item() method to convert them to a python type before sending to yaml which cannot handle the numpy scalars.