summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Wiebe <mwwiebe@gmail.com>2011-04-13 15:04:17 -0700
committerMark Wiebe <mwwiebe@gmail.com>2011-04-22 14:04:33 -0700
commit58b77b2268c36c4617fb7f1f4b1227eb347d2d5b (patch)
tree82480d89e849949f4da1e8abc4ad9190f177eeff
parentd97a5e37b2085db9558ff64716e29e6cbf791a4c (diff)
downloadnumpy-58b77b2268c36c4617fb7f1f4b1227eb347d2d5b.tar.gz
DOC: Document the new keyword arguments for ufuncs
-rw-r--r--doc/source/reference/ufuncs.rst39
-rw-r--r--numpy/add_newdocs.py11
2 files changed, 48 insertions, 2 deletions
diff --git a/doc/source/reference/ufuncs.rst b/doc/source/reference/ufuncs.rst
index 987a2ec15..0e7da347e 100644
--- a/doc/source/reference/ufuncs.rst
+++ b/doc/source/reference/ufuncs.rst
@@ -286,6 +286,44 @@ advanced usage and will not typically be used.
.. index::
pair: ufunc; keyword arguments
+*out*
+
+ .. versionadded:: 1.6
+
+ The first output can provided as either a positional or a keyword parameter.
+
+*casting*
+
+ .. versionadded:: 1.6
+
+ Provides a policy for what kind of casting is permitted. For compatibility
+ with previous versions of NumPy, this defaults to 'unsafe'. May be 'no',
+ 'equiv', 'safe', 'same_kind', or 'unsafe'. See :func:`can_cast` for
+ explanations of the parameter values.
+
+*order*
+
+ .. versionadded:: 1.6
+
+ Specifies the calculation iteration order/memory layout of the output array.
+ Defaults to 'K'. 'C' means the output should be C-contiguous, 'F' means
+ F-contiguous, 'A' means F-contiguous if the inputs are F-contiguous, C-contiguous
+ otherwise, and 'K' means to match the element ordering of the inputs
+ as closely as possible.
+
+*dtype*
+
+ .. versionadded:: 1.6
+
+ Overrides the dtype of the calculation and output arrays. Similar to *sig*.
+
+*subok*
+
+ .. versionadded:: 1.6
+
+ Defaults to true. If set to false, the output will always be a strict
+ array, not a subtype.
+
*sig*
Either a data-type, a tuple of data-types, or a special signature
@@ -310,6 +348,7 @@ advanced usage and will not typically be used.
in a loop.
+
Attributes
----------
diff --git a/numpy/add_newdocs.py b/numpy/add_newdocs.py
index a2925eeba..37f326867 100644
--- a/numpy/add_newdocs.py
+++ b/numpy/add_newdocs.py
@@ -1552,8 +1552,15 @@ add_newdoc('numpy.core.multiarray', 'can_cast',
Data type, scalar, or array to cast from.
totype : dtype or dtype specifier
Data type to cast to.
- casting : casting rule
- May be any of 'no', 'equiv', 'safe', 'same_kind', or 'unsafe'.
+ casting : {'no', 'equiv', 'safe', 'same_kind', 'unsafe'}, optional
+ Controls what kind of data casting may occur.
+
+ * 'no' means the data types should not be cast at all.
+ * 'equiv' means only byte-order changes are allowed.
+ * 'safe' means only casts which can preserve values are allowed.
+ * 'same_kind' means only safe casts or casts within a kind,
+ like float64 to float32, are allowed.
+ * 'unsafe' means any data conversions may be done.
Returns
-------