data-apis / array-api-compat

Compatibility layer for common array libraries to support the Array API
https://data-apis.org/array-api-compat/
MIT License
69 stars 22 forks source link

Pass keyword arguments through to wrapped functions #10

Closed asmeurer closed 1 year ago

asmeurer commented 1 year ago

@rgommers mentioned this in the consortium meeting today, and I realized that this isn't actually the case. But it should be straightforward to add **kwargs to the wrappers and pass it through. For instance, np.asarray has the order argument and it should be possible to use it with array_api_compat.numpy.asarray.

Another slightly related point is that we should remove the wrapping for the pure rename aliases. The only reason I used wrappers there was to avoid the duplication between numpy and cupy, but this isn't really a big deal. A reason to fix this is that something like array_api_compat.numpy.asin isn't actually a ufunc, but it could be if we just set asin = np.arcsin.

rgommers commented 1 year ago

This was fixed a long time ago in commit 055f7931f1, which mentions it fixes this issue (auto-close just didn't work).