-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
ENH: Add copy and device keyword to np.asanyarray to match np.asarray #26580
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
ENH: Add copy and device keyword to np.asanyarray to match np.asarray #26580
Conversation
This needs a release note. It should be versionadded for 2.1 since I don't think it's an emergency to backport this for 2.0. Also needs new tests. |
I've added a release note as per suggested. Is there a way to flag this change for 2.1 in the release note? As for the tests, the underlying implementation for |
That is automatic in the release notes; the tooling knows how to assemble the release notes for the next version from these snippets. And you already used
Yes, this will be useful. Any public API construct should have at least a single direct test even when the underlying machinery is tested extensively in some other way. Probably |
Oh my bad, I completely forgot I did that, I've made the changes. If the only new tests to add are related to the static PyObject *
array_device(PyArrayObject *self, void *NPY_UNUSED(ignored))
{
return PyUnicode_FromString("cpu");
} |
I think you only test that |
Okay, I've added new tests |
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.
LGTM. One typo and an optional vertical spacing suggestion
Co-authored-by: Matti Picus <matti.picus@gmail.com>
Co-authored-by: Matti Picus <matti.picus@gmail.com>
Co-authored-by: Matti Picus <matti.picus@gmail.com>
Yea I think adding one more newline looks nicer too, Ive commited the suggestions |
Thanks @JuliaPoo |
See #26196