Repository navigation
BUG: a avoid deprecation warning from numpy.char.chararray (table) - #19218
Conversation
|
Thank you for your contribution to Astropy! 🌌 This checklist is meant to remind the package maintainers who will review this pull request of some common things to look for.
|
…y.char.chararray (table)
| def tolist(self): | ||
| if self.dtype.kind == "S": | ||
| return np.char.chararray.decode(self, encoding="utf-8").tolist() | ||
| return np.char.decode(self, encoding="utf-8").tolist() |
There was a problem hiding this comment.
Would probably have been better to use np.strings.decode right away.
There was a problem hiding this comment.
It can be done when np.char is deprecated but might as well do it now.
There was a problem hiding this comment.
We can certainly open a new ticket to follow up on #19126, specifically about ridding astropy of all remaining use cases of np.char, though it's not perfectly clear to me whether it'll actually go away in the future:
This submodule is considered legacy and will no longer receive updates. This could also mean it will be removed in future NumPy versions.
(notice the use of conditional)
Description
ref #19216