-
-
Notifications
You must be signed in to change notification settings - Fork 12k
ENH: ma.asarray() and ma.asanyarray() will pass through input of the cor... #4045
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
Conversation
…correct type. If x is of type MaskedArray for ma.asarray(x) or any subtype of MaskedArray for ma.asanyarray(x), these functions will simply return x. This makes them consistent with their numpy counterparts. Closes numpygh-4043.
|
@abalkin Test failures are universal. You should be able to check at home and fix them up. |
Previous implementation relied on ma.asarray() to always create a new object. See numpygh-4043.
|
Travis is green now. a49c279 illustrates possible backward-compatibility problems. |
|
The documentation of the function needs fixing/updating. It isn't clear to me that the function should always return a new array, doing so may break current code. What is the argument for this change? That argument should also be in the commit message. |
|
As such, I think it would be correct to just pass through a masked array. But maybe we should ping the mailing list about it. It could potentially create some backward compatibility problems, afterall. Needs a prominent warning in the release notes in any case. |
|
Looks like it should already not be making a copy unless needed If it is slow, or not working correctly, maybe |
|
LGTM, but I notice that |
|
Or rather, I'll put this in to encourage you ;) And then could you fix the documentation/functions? |
ENH: ma.asarray() and ma.asanyarray() will pass through input of the cor...
...rect type.
If x is of type MaskedArray for ma.asarray(x) or any subtype of
MaskedArray for ma.asanyarray(x), these functions will simply return x.
This makes them consistent with their numpy counterparts.
Closes gh-4043.