geomagpy/magpy

VisibleDeprecationWarning

stephanbracke opened this issue · 1 comments

When using magpy a lot of deprecatiob warnings show up behind the scenes one that I wanted to eliminate in my scripts is

  • VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences

I found out that magpy uses a lot the method np.asarray(array) by changing it into np.asarray(array,dtype=object) the warning dissappears as explanation I found : VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray.
A carefully executed find/replace will do the trick but it is widely spread in the code

Done and tested for version 1.0.3: 2b845ae