From ee95f34a29e4e39804f0cedd6a2fadfda9143a57 Mon Sep 17 00:00:00 2001
From: "wfspotz@sandia.gov"
Date: Fri, 13 Apr 2007 20:38:36 +0000
Subject: Reformatted numpy.i routines descriptions
---
numpy/doc/swig/numpy_swig.html | 204 ++++++++++++++++++++++++++++++----------
numpy/doc/swig/numpy_swig.pdf | Bin 138385 -> 143924 bytes
numpy/doc/swig/numpy_swig.txt | 209 ++++++++++++++++++++++++++++++++---------
3 files changed, 318 insertions(+), 95 deletions(-)
(limited to 'numpy/doc/swig')
diff --git a/numpy/doc/swig/numpy_swig.html b/numpy/doc/swig/numpy_swig.html
index 5348c5fbf..eadfc3f3a 100644
--- a/numpy/doc/swig/numpy_swig.html
+++ b/numpy/doc/swig/numpy_swig.html
@@ -745,56 +745,160 @@ order. Equivalent to (PyArray_IS
-
-- char* pytype_string(PyObject* py_obj)
-- Given a PyObject*, return a string describing its type.
-- char* typecode_string(int typecode)
-- Given a NumPy integer typecode, return a string describing the type.
-- int type_match(int actual_type, int desired_type)
-- Make sure input has correct NumPy type. Allow character and
-byte to match. Also allow int and long to match. This is
-deprecated . You should use PyArray_EquivTypenums() instead.
-- PyArrayObject* obj_to_array_no_conversion(PyObject* input, int typecode)
-- Given a PyObject*, cast it to a PyArrayObject* if legal.
-If not, set the python error string appropriately and return
-NULL.
-- PyArrayObject* obj_to_array_allow_conversion(PyObject* input, int typecode, int* is_new_object)
-- Convert the given PyObject* to a NumPy array with the given
-typecode. On Success, return a valid PyArrayObject* with the
-correct type. On failure, the python error string will be set and
-the routine returns NULL.
-- PyArrayObject* make_contiguous(PyArrayObject* ary, int* is_new_object, int min_dims, int max_dims)
-- Given a PyArrayObject*, check to see if it is contiguous. If
-so, return the input pointer and flag it as not a new object. If
-it is not contiguous, create a new PyArrayObject* using the
-original data, flag it as a new object and return the pointer.
-- PyArrayObject* obj_to_array_contiguous_allow_conversion(PyObject* input, int typecode, int* is_new_object)
-- Convert a given PyObject* to a contiguous PyArrayObject*
-of the specified type. If the input object is not a contiguous
+
pytype_string()
+
+Return type: char*
+Arguments:
+
+- PyObject* py_obj, a general python object.
+
+Return a string describing the type of py_obj.
+
+typecode_string()
+
+Return type: char*
+Arguments:
+
+- int typecode, a NumPy integer typecode.
+
+Return a string describing the type corresponding to the NumPy
+typecode.
+
+type_match()
+
+Return type: int
+Arguments:
+
+- int actual_type, the NumPy typecode of a NumPy array.
+- int desired_type, the desired NumPy typecode.
+
+Make sure that actual_type is compatible with
+desired_type. For example, this allows character and
+byte types, or int and long types, to match. This is now
+equivalent to PyArray_EquivTypenums().
+
+obj_to_array_no_conversion()
+
+Return type: PyArrayObject*
+Arguments:
+
+- PyObject* input, a general python object.
+- int typecode, the desired NumPy typecode.
+
+Cast input to a PyArrayObject* if legal, and ensure that
+it is of type typecode. If input cannot be cast, or the
+typecode is wrong, set a python error and return NULL.
+
+obj_to_array_allow_conversion()
+
+Return type: PyArrayObject*
+Arguments:
+
+- PyObject* input, a general python object.
+- int typecode, the desired NumPy typecode of the resulting
+array.
+- int* is_new_object, returns a value of 0 if no conversion
+performed, else 1.
+
+Convert input to a NumPy array with the given typecode.
+On success, return a valid PyArrayObject* with the correct
+type. On failure, the python error string will be set and the
+routine returns NULL.
+
+make_contiguous()
+
+Return type: PyArrayObject*
+Arguments:
+
+- PyArrayObject* ary, a NumPy array.
+- int* is_new_object, returns a value of 0 if no conversion
+performed, else 1.
+- int min_dims, minimum allowable dimensions.
+- int max_dims, maximum allowable dimensions.
+
+Check to see if ary is contiguous. If so, return the input
+pointer and flag it as not a new object. If it is not contiguous,
+create a new PyArrayObject* using the original data, flag it
+as a new object and return the pointer.
+
+obj_to_array_contiguous_allow_conversion()
+
+Return type: PyArrayObject*
+Arguments:
+
+- PyObject* input, a general python object.
+- int typecode, the desired NumPy typecode of the resulting
+array.
+- int* is_new_object, returns a value of 0 if no conversion
+performed, else 1.
+
+Convert input to a contiguous PyArrayObject* of the
+specified type. If the input object is not a contiguous
PyArrayObject*, a new one will be created and the new object
-flag will be set.
-- int require_contiguous(PyArrayObject* ary)
-- Test whether a PyArrayObject* is contiguous. If array is
-contiguous, return 1. Otherwise, set the python error string and
-return 0.
-- int require_native(PyArray_Object* ary)
-- Require that a numpy array is not byte-swapped. If the array is
-not byte-swapped, return 1. Otherwise, set the python error string
-and return 0.
-- int require_dimensions(PyArrayObject* ary, int exact_dimensions)
-- Require the given PyArrayObject* to have a specified number of
-dimensions. If the array has the specified number of dimensions,
-return 1. Otherwise, set the python error string and return 0.
-- int require_dimensions_n(PyArrayObject* ary, int* exact_dimensions, int n)
-- Require the given PyArrayObject* to have one of a list of
-specified number of dimensions. If the array has one of the
-specified number of dimensions, return 1. Otherwise, set the
-python error string and return 0.
-- int require_size(PyArrayObject* ary, int* size, int n)
-- Require the given PyArrayObject* to have a specified shape.
-If the array has the specified shape, return 1. Otherwise, set
-the python error string and return 0.
-
+flag will be set.
+
+
require_contiguous()
+
+Return type: int
+Arguments:
+
+- PyArrayObject* ary, a NumPy array.
+
+Test whether ary is contiguous. If so, return 1. Otherwise,
+set a python error and return 0.
+
+
require_native()
+
+Return type: int
+Arguments:
+
+- PyArray_Object* ary, a NumPy array.
+
+Require that ary is not byte-swapped. If the array is not
+byte-swapped, return 1. Otherwise, set a python error and return
+0.
+
+
require_dimensions()
+
+Return type: int
+Arguments:
+
+- PyArrayObject* ary, a NumPy array.
+- int exact_dimensions, the desired number of dimensions.
+
+Require ary to have a specified number of dimensions. If the
+array has the specified number of dimensions, return 1.
+Otherwise, set a python error and return 0.
+
+
require_dimensions_n()
+
+Return type: int
+Arguments:
+
+- PyArrayObject* ary, a NumPy array.
+- int* exact_dimensions, an array of integers representing
+acceptable numbers of dimensions.
+- int n, the length of exact_dimensions.
+
+Require ary to have one of a list of specified number of
+dimensions. If the array has one of the specified number of
+dimensions, return 1. Otherwise, set the python error string and
+return 0.
+
+
require_size()
+
+Return type: int
+Arguments:
+
+- PyArrayObject* ary, a NumPy array.
+- npy_int* size, an array representing the desired lengths of
+each dimension.
+- int n, the length of size.
+
+Require ary to have a specified shape. If the array has the
+specified shape, return 1. Otherwise, set the python error string
+and return 0.
+
@@ -948,7 +1052,7 @@ possible.
diff --git a/numpy/doc/swig/numpy_swig.pdf b/numpy/doc/swig/numpy_swig.pdf
index 7400f93df..6e18049c3 100644
Binary files a/numpy/doc/swig/numpy_swig.pdf and b/numpy/doc/swig/numpy_swig.pdf differ
diff --git a/numpy/doc/swig/numpy_swig.txt b/numpy/doc/swig/numpy_swig.txt
index fbd8c2dfa..19d9045a9 100644
--- a/numpy/doc/swig/numpy_swig.txt
+++ b/numpy/doc/swig/numpy_swig.txt
@@ -436,75 +436,194 @@ Macros
Routines
--------
- **char* pytype_string(PyObject* py_obj)**
- Given a ``PyObject*``, return a string describing its type.
+ **pytype_string()**
+ Return type: ``char*``
- **char* typecode_string(int typecode)**
- Given a `NumPy`_ integer typecode, return a string describing the type.
+ Arguments:
+ * ``PyObject* py_obj``, a general python object.
- **int type_match(int actual_type, int desired_type)**
- Make sure input has correct `NumPy`_ type. Allow character and
- byte to match. Also allow int and long to match. This is
- deprecated . You should use ``PyArray_EquivTypenums()`` instead.
+ Return a string describing the type of ``py_obj``.
- **PyArrayObject* obj_to_array_no_conversion(PyObject* input, int typecode)**
- Given a ``PyObject*``, cast it to a ``PyArrayObject*`` if legal.
- If not, set the python error string appropriately and return
- ``NULL``.
+ **typecode_string()**
+ Return type: ``char*``
- **PyArrayObject* obj_to_array_allow_conversion(PyObject* input, int typecode, int* is_new_object)**
- Convert the given ``PyObject*`` to a `NumPy`_ array with the given
- typecode. On Success, return a valid ``PyArrayObject*`` with the
- correct type. On failure, the python error string will be set and
- the routine returns ``NULL``.
+ Arguments:
+ * ``int typecode``, a `NumPy`_ integer typecode.
- **PyArrayObject* make_contiguous(PyArrayObject* ary, int* is_new_object, int min_dims, int max_dims)**
- Given a ``PyArrayObject*``, check to see if it is contiguous. If
- so, return the input pointer and flag it as not a new object. If
- it is not contiguous, create a new ``PyArrayObject*`` using the
- original data, flag it as a new object and return the pointer.
+ Return a string describing the type corresponding to the `NumPy`_
+ ``typecode``.
+ **type_match()**
- **PyArrayObject* obj_to_array_contiguous_allow_conversion(PyObject* input, int typecode, int* is_new_object)**
- Convert a given ``PyObject*`` to a contiguous ``PyArrayObject*``
- of the specified type. If the input object is not a contiguous
+ Return type: ``int``
+
+ Arguments:
+
+ * ``int actual_type``, the `NumPy`_ typecode of a `NumPy`_ array.
+
+ * ``int desired_type``, the desired `NumPy`_ typecode.
+
+ Make sure that ``actual_type`` is compatible with
+ ``desired_type``. For example, this allows character and
+ byte types, or int and long types, to match. This is now
+ equivalent to ``PyArray_EquivTypenums()``.
+
+
+ **obj_to_array_no_conversion()**
+
+ Return type: ``PyArrayObject*``
+
+ Arguments:
+
+ * ``PyObject* input``, a general python object.
+
+ * ``int typecode``, the desired `NumPy`_ typecode.
+
+ Cast ``input`` to a ``PyArrayObject*`` if legal, and ensure that
+ it is of type ``typecode``. If ``input`` cannot be cast, or the
+ ``typecode`` is wrong, set a python error and return ``NULL``.
+
+
+ **obj_to_array_allow_conversion()**
+
+ Return type: ``PyArrayObject*``
+
+ Arguments:
+
+ * ``PyObject* input``, a general python object.
+
+ * ``int typecode``, the desired `NumPy`_ typecode of the resulting
+ array.
+
+ * ``int* is_new_object``, returns a value of 0 if no conversion
+ performed, else 1.
+
+ Convert ``input`` to a `NumPy`_ array with the given ``typecode``.
+ On success, return a valid ``PyArrayObject*`` with the correct
+ type. On failure, the python error string will be set and the
+ routine returns ``NULL``.
+
+
+ **make_contiguous()**
+
+ Return type: ``PyArrayObject*``
+
+ Arguments:
+
+ * ``PyArrayObject* ary``, a `NumPy`_ array.
+
+ * ``int* is_new_object``, returns a value of 0 if no conversion
+ performed, else 1.
+
+ * ``int min_dims``, minimum allowable dimensions.
+
+ * ``int max_dims``, maximum allowable dimensions.
+
+ Check to see if ``ary`` is contiguous. If so, return the input
+ pointer and flag it as not a new object. If it is not contiguous,
+ create a new ``PyArrayObject*`` using the original data, flag it
+ as a new object and return the pointer.
+
+
+ **obj_to_array_contiguous_allow_conversion()**
+
+ Return type: ``PyArrayObject*``
+
+ Arguments:
+
+ * ``PyObject* input``, a general python object.
+
+ * ``int typecode``, the desired `NumPy`_ typecode of the resulting
+ array.
+
+ * ``int* is_new_object``, returns a value of 0 if no conversion
+ performed, else 1.
+
+ Convert ``input`` to a contiguous ``PyArrayObject*`` of the
+ specified type. If the input object is not a contiguous
``PyArrayObject*``, a new one will be created and the new object
flag will be set.
- **int require_contiguous(PyArrayObject* ary)**
- Test whether a ``PyArrayObject*`` is contiguous. If array is
- contiguous, return 1. Otherwise, set the python error string and
+ **require_contiguous()**
+
+ Return type: ``int``
+
+ Arguments:
+
+ * ``PyArrayObject* ary``, a `NumPy`_ array.
+
+ Test whether ``ary`` is contiguous. If so, return 1. Otherwise,
+ set a python error and return 0.
+
+
+ **require_native()**
+
+ Return type: ``int``
+
+ Arguments:
+
+ * ``PyArray_Object* ary``, a `NumPy`_ array.
+
+ Require that ``ary`` is not byte-swapped. If the array is not
+ byte-swapped, return 1. Otherwise, set a python error and return
+ 0.
+
+ **require_dimensions()**
+
+ Return type: ``int``
+
+ Arguments:
+
+ * ``PyArrayObject* ary``, a `NumPy`_ array.
+
+ * ``int exact_dimensions``, the desired number of dimensions.
+
+ Require ``ary`` to have a specified number of dimensions. If the
+ array has the specified number of dimensions, return 1.
+ Otherwise, set a python error and return 0.
+
+
+ **require_dimensions_n()**
+
+ Return type: ``int``
+
+ Arguments:
+
+ * ``PyArrayObject* ary``, a `NumPy`_ array.
+
+ * ``int* exact_dimensions``, an array of integers representing
+ acceptable numbers of dimensions.
+
+ * ``int n``, the length of ``exact_dimensions``.
+
+ Require ``ary`` to have one of a list of specified number of
+ dimensions. If the array has one of the specified number of
+ dimensions, return 1. Otherwise, set the python error string and
return 0.
- **int require_native(PyArray_Object* ary)**
- Require that a numpy array is not byte-swapped. If the array is
- not byte-swapped, return 1. Otherwise, set the python error string
- and return 0.
+ **require_size()**
+
+ Return type: ``int``
- **int require_dimensions(PyArrayObject* ary, int exact_dimensions)**
- Require the given ``PyArrayObject*`` to have a specified number of
- dimensions. If the array has the specified number of dimensions,
- return 1. Otherwise, set the python error string and return 0.
+ Arguments:
+ * ``PyArrayObject* ary``, a `NumPy`_ array.
- **int require_dimensions_n(PyArrayObject* ary, int* exact_dimensions, int n)**
- Require the given ``PyArrayObject*`` to have one of a list of
- specified number of dimensions. If the array has one of the
- specified number of dimensions, return 1. Otherwise, set the
- python error string and return 0.
+ * ``npy_int* size``, an array representing the desired lengths of
+ each dimension.
+ * ``int n``, the length of ``size``.
- **int require_size(PyArrayObject* ary, int* size, int n)**
- Require the given ``PyArrayObject*`` to have a specified shape.
- If the array has the specified shape, return 1. Otherwise, set
- the python error string and return 0.
+ Require ``ary`` to have a specified shape. If the array has the
+ specified shape, return 1. Otherwise, set the python error string
+ and return 0.
Beyond the Provided Typemaps
--
cgit v1.2.1