geomagpy / magpy

MagPy (or GeomagPy) is a Python package for analysing and displaying geomagnetic data.
BSD 3-Clause "New" or "Revised" License
49 stars 27 forks source link

VisibleDeprecationWarning #108

Closed stephanbracke closed 2 years ago

stephanbracke commented 3 years ago

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

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

leonro commented 2 years ago

Done and tested for version 1.0.3: 2b845aefa69fb16191b2fd224f372652faf81167