Repository navigation
ENH: add support for NEP 35 array constructors (require, identiy, eye, tri, genfromtxt and loadtxt) with like=Quantity(...)) - #17130
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.
|
|
👋 Thank you for your draft pull request! Do you know that you can use |
… `eye`, `tri`, `genfromtxt` and `loadtxt`) with `like=Quantity(...))`
b33c677 to
25cb626
Compare
7c69faf to
0eb53d4
Compare
mhvk
left a comment
There was a problem hiding this comment.
Thanks, great to see this wrapped up! I'm not 100% sure we can fully support require (in particular "OWNDATA"), but to be honest, I'd never even heard about the function, so think it is sufficiently obscure not to worry... (Also, probably just a consequence of #7244.)
| <Quantity [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] m> | ||
| >>> np.eye(3, like=q) | ||
| <Quantity [[1., 0., 0.], | ||
| [0., 1., 0.], |
There was a problem hiding this comment.
thanks. Fixed !
0eb53d4 to
78a915d
Compare
mhvk
left a comment
There was a problem hiding this comment.
OK, thanks for the quick fix! Will set it to merge...
Description
Concludes the first half of #17124 (
units)