Repository navigation
Ensure broadcast_arrays returns sequence also for single Masked instance - #16842
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.
|
| self.check2(np.broadcast_arrays, subok=False) | ||
| # Regression test for bug for single array | ||
| ba = np.broadcast_arrays(self.ma, subok=True) | ||
| assert len(ba) == 1 |
There was a problem hiding this comment.
I was initially confused by this first new assertion. I think it'd help readability to also assert the return value is indeed a tuple.
| assert len(ba) == 1 | |
| assert isinstance(ba, tuple) | |
| assert len(ba) == 1 |
neutrinoceros
left a comment
There was a problem hiding this comment.
nice to get the code both simpler and more correct. Just one simple suggestion to improve the test but otherwise LGTM. Thanks Marten !
38aeeed to
07bed38
Compare
|
Thanks, I made the change and also rebased, so that #16843 is in and the full |
07bed38 to
8ce1a20
Compare
…lso for single Masked instance
|
Sorry about the delay. I wasn't working over the weekend. Glad Nathaniel able to help. Thanks, all! |
…842-on-v6.1.x Backport PR #16842 on branch v6.1.x (Ensure broadcast_arrays returns sequence also for single Masked instance)
And you definitely shouldn't feel you have to, obviously!! I just ping'd because then I knew I wouldn't forget... |
This pull request is to address a small bug in the implementation of
np.broadcast_arraysfor a singleMaskedelement, ensuring a sequence is also returned in that case.