New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NDData show units #11553
NDData show units #11553
Conversation
👍 for me, but @mwcraig should approve as the nddata maintainer. |
fc5b382
to
f68a873
Compare
f68a873
to
96386fc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, @nstarman, this looks great!
I opened an issue for this at #11648 |
Description
Now NDData with units shows the units on
str()
andrepr()
. Importantly,repr
maintains its current level of fidelity toeval(repr(x)) == x
(I add a check for this to the tests)@mhvk @saimn @mwcraig
Fixes #11541
Followup ideas:
eval(repr(x)) == x
doesn't actually work for NDData, with or without units, even if they are identical attribute-by-attribute. Modding__eq__
would be good.