From c5d8f5c9261a887349f46f4a12047a2d0b99d083 Mon Sep 17 00:00:00 2001 From: Matthias Geier Date: Sun, 1 Nov 2015 09:27:35 +0100 Subject: DOC: fix method signatures in "array subclasses" * Change ".. function::" -> ".. method::" * Remove "self" argument * Change "self" to "obj" in __array_finalize__ --- doc/source/reference/arrays.classes.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'doc/source/reference/arrays.classes.rst') diff --git a/doc/source/reference/arrays.classes.rst b/doc/source/reference/arrays.classes.rst index 5716f4562..b82f7d33c 100644 --- a/doc/source/reference/arrays.classes.rst +++ b/doc/source/reference/arrays.classes.rst @@ -39,9 +39,9 @@ Special attributes and methods Numpy provides several hooks that classes can customize: -.. function:: class.__numpy_ufunc__(self, ufunc, method, i, inputs, **kwargs) +.. method:: class.__numpy_ufunc__(ufunc, method, i, inputs, **kwargs) - .. versionadded:: 1.10 + .. versionadded:: 1.11 Any class (ndarray subclass or not) can define this method to override behavior of Numpy's ufuncs. This works quite similarly to @@ -109,7 +109,7 @@ Numpy provides several hooks that classes can customize: your_obj)`` always calls only your ``__numpy_ufunc__``, as expected. -.. function:: class.__array_finalize__(self) +.. method:: class.__array_finalize__(obj) This method is called whenever the system internally allocates a new array from *obj*, where *obj* is a subclass (subtype) of the @@ -118,7 +118,7 @@ Numpy provides several hooks that classes can customize: to update meta-information from the "parent." Subclasses inherit a default implementation of this method that does nothing. -.. function:: class.__array_prepare__(array, context=None) +.. method:: class.__array_prepare__(array, context=None) At the beginning of every :ref:`ufunc `, this method is called on the input object with the highest array @@ -130,7 +130,7 @@ Numpy provides several hooks that classes can customize: the subclass and update metadata before returning the array to the ufunc for computation. -.. function:: class.__array_wrap__(array, context=None) +.. method:: class.__array_wrap__(array, context=None) At the end of every :ref:`ufunc `, this method is called on the input object with the highest array priority, or @@ -149,7 +149,7 @@ Numpy provides several hooks that classes can customize: possibility for the Python type of the returned object. Subclasses inherit a default value of 0.0 for this attribute. -.. function:: class.__array__([dtype]) +.. method:: class.__array__([dtype]) If a class (ndarray subclass or not) having the :func:`__array__` method is used as the output object of an :ref:`ufunc -- cgit v1.2.1