Repository navigation
BUG: add missing ufunc helpers for np.matvec and np.vecmat - #17464
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.
|
5ae825c to
57e713a
Compare
np.matvec and np.vecmat
There was a problem hiding this comment.
Thanks! I could have thought about this myself...
One request: would you be able to add tests? In astropy/units/tests/test_quantity_ufuncs.py (after matmul/vecdot) and in astropy/utils/masked/test_masked.py, adding to or with the existing vecmat and matvec tests that use @.
p.s. And, yes, should be backported - we always try to ensure the current version will run with latest numpy.
57e713a to
1303114
Compare
|
test added |
mhvk
left a comment
There was a problem hiding this comment.
See note about location. Also, please do add a test in utils/masked (see previous review message) - it should not require explicitly adding to anything, but we need to test that!
| assert_array_equal(n2, expected2) | ||
|
|
||
|
|
||
| @pytest.mark.skipif(NUMPY_LT_2_3, reason="np.matvec and np.vecmat are new in NumPy 2.3") |
There was a problem hiding this comment.
Sorry to be annoying, but this should be in test_quantity_ufunc (gufuncs are there too...), with matmul and vecdot
There was a problem hiding this comment.
no annoyance at all. Thanks for your attention to details !
1303114 to
727094b
Compare
I'm actually getting unexpected errors from my test, and I'm running out of time to fix them today, so I just pushed a broken test for now. |
727094b to
cb64713
Compare
mhvk
left a comment
There was a problem hiding this comment.
Since there didn't seem to be much wrong with the test you wrote, I force-pushed a quick fix. With this, it all looks good, so approving and enabling merge.
…vec` and `np.vecmat`
…464-on-v7.0.x Backport PR #17464 on branch v7.0.x (BUG: add missing ufunc helpers for `np.matvec` and `np.vecmat`)
Description
example logs
xref: numpy/numpy#25675
given how small the change, I think we should backport to 7.0.1