pyuvdata
pyuvdata copied to clipboard
Numpy deprecation warning about passing None as a shape argument for array creation routines
During unit tests, I've been seeing a decrepacion warning popping up over and over again:
DeprecationWarning: Passing None into shape arguments as an alias for () is deprecated.
The vast majority (possibly all) of these warnings seem to be coming seem to be coming numpy array creation routines (e.g., numpy.ndarray
), in particular from the method __getitem__
of h5py
objects when using a H5Py version prior to 3.2.0. I don't know when the numpy behavior changed, but given that my "fresh" installs have sometimes been putting in versions prior to this, perhaps it would be good to add an explicit requirement for the H5Py version for pyuvdata prior to numpy converting the above from a warning into an error.
I used to see these, but I don't anymore. I'm on h5py version 3.2.1 and the CI tests are mostly on 3.3.0 (where the warnings don't show up either).
The h5py release notes suggest it was fixed in 3.2.1: https://docs.h5py.org/en/stable/whatsnew/3.2.html#bug-fix-release
Should we update our requirements to require 3.2.1 or later? Since it's just a deprecation warning I'm not sure we have to, but the warning is obtuse and might worry users.
I'd be in favor of upping the requirement, if for no other reason than the aforementioned obtuseness. I definitely spent more time than I care to admit chasing this down because I thought I'd broken something in building up #979.
I also imagine that at some point, this warning will become an error, so implementing the version requirement now may save some effort chasing this down later on when some unfortunate user (w/ an old version of h5py) can't figure out why the package won't load their data without erroring out.
We decided not to actually change our required h5py version because when this is a error rather than a deprecation warning, the conflict will be handled by h5py requiring a certain numpy version.
This was fixed in #1417 when we increased our h5py requirement.