ornladios / ADIOS

The old ADIOS 1.x code repository. Look for ADIOS2 for new repo
https://csmd.ornl.gov/adios
Other
54 stars 40 forks source link

Numpy: Scalar Attributes Warning #201

Closed ax3l closed 4 years ago

ax3l commented 4 years ago

Upgrade the conversion of returned scalar attributes to the recommended usage in numpy.

In Numpy 1.16 and newer, the old usage throws a warning of the form ( https://github.com/numpy/numpy/pull/12123 )

DeprecationWarning: np.asscalar(a) is deprecated since NumPy v1.16, use a.item() instead

It is likely this will be removed in Numpy 1.18 and newer, so let us fix this right away.

ndarray.item() is available since a long time/always, so that is a save change.

ax3l commented 4 years ago

ping @pnorbert @jychoi-hpc : this fixes a verbose warning in user-code :)

jychoi-hpc commented 4 years ago

It looks good to me. I found there are four other places to change. I will merge this and make another commit to change them all.

ax3l commented 4 years ago

Ok, please ping me on the commit so I can cherry-pick it into package managers.

ax3l commented 3 years ago

@jychoi-hpc did you push the other locations that throw warnings? :)

jychoi-hpc commented 3 years ago

I just pushed the changes to the master branch. Please let me know if you have any problem.

ax3l commented 3 years ago

Thank you, linking commit f33031ee206d552b286674d0f1641b9aca6b9100 for reference :)