| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Usefull for crossreferencing and intersphinx
Here is a snippet to update it if other neps are missing it:
In [1]: neps = !ls nep-0*
...: for nep in neps:
...: number = nep[6:8]
...: with open(nep, 'r') as f:
...: data = f.read()
...:
...: if f'.. _NEP{number}:' in data:
...: continue
...: with open(nep, 'w') as f:
...: f.write('.. _NEP'+number+':\n')
...: f.write(data)
...:
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
I think this is an important warning to include for subclass authors.
Otherwise, we will be expanding our exposure of internal APIs as part of
``__array_function__``. All things being equal, it's great when things "just
work" subclasses, but I don't want to guarantee it. In particular, I would be
very displeased if ``__array_function__`` leads to NumPy adding more subclass
specific hacks like always calling ``mean()`` inside ``median()`` (GH-3846).
mhvk: please take a look.
|
| |
|
|
|
|
|
|
|
|
|
| |
This reverts most of the changes from GH-13305, and adds a brief discussion
of ``__skip_array_function__`` into the "Alternatives" section.
We still use NumPy's implementation of the function internally inside
``ndarray.__array_function__``, but I've given it a new name in the NEP
(``_implementation``) to indicate that it's a private API.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Fix GH12974
This includes two minor changes to NEP-18 that will need to be implemented in
NumPy:
- The ``__numpy_implementation__`` attribute is documented and officially
supported as a way to defer to NumPy's own implementation.
- I have noted that dispatcher functions should be given the same name as
implementations, which should result in more interprettable error messages.
|
| |
|
|\
| |
| | |
MAINT: disable `__array_function__` dispatch unless environment variable set
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Per discussion on the mailing list, __array_function__ isn't quite ready to
release as part of NumPy 1.16:
https://mail.python.org/pipermail/numpy-discussion/2018-November/078949.html
We'd like to improve performance a bit, and it will be easier to support
introspection on NumPy functions if we support Python 3 only.
So for now, you need to set the environment variable
``NUMPY_EXPERIMENTAL_ARRAY_FUNCTION=1`` to enable dispatching.
|
|/
|
|
|
| |
Per our discussion on the mailing list:
https://mail.python.org/pipermail/numpy-discussion/2018-November/078911.html
|
| |
|
| |
|
|
|
|
| |
As discussion in GH12140
|
|
|
|
|
|
|
| |
The main change is replacing `try_array_function_override` with
`array_function_implementation_or_override` (our current implementation).
I also fixed a few typos.
|
| |
|
| |
|
|
|
|
|
| |
Per mailing list discussion in:
https://mail.python.org/pipermail/numpy-discussion/2018-August/078493.html
|
| |
|
|
|
| |
We should wait to merge this until Nathaniel's has had the chance to read it.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* WIP: additional revisions for NEP-18 (__array_function__)
* Rename: @dispatch -> @array_function_dispatch
* Clarify the possibility of a limited core API
* Update magic decorators; add other protocol choices
* Add section on extensibility
* another sentence
* Move implementation specific arguments to Alternatives
* Add discussion links
* Note on return value/types and typing
* Add note about why we write issubclass(t, MyArray)
* Spelling and minor rewording
* Add Marten, Hameer and Eric as co-authors
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I would particularly like to highlight a draft implementation (in pure Python
for now). Hopefuly this will be a useful for driving the discussion forward:
https://nbviewer.jupyter.org/gist/shoyer/1f0a308a06cd96df20879a1ddb8f0006
TODOs before merging:
- [ ] review from mrocklin
Other TODOs:
- [ ] decide if we want to change what is passed on to `__array_function__`
implementations: should we include `overloaded_args` and/or
`relevant_args` as well or instead?
- [ ] add some discussion about static typing / PEP-484?
|
|
|