summaryrefslogtreecommitdiff
path: root/doc/source/user
diff options
context:
space:
mode:
authorWarren Weckesser <warren.weckesser@gmail.com>2020-05-15 20:18:52 -0400
committerWarren Weckesser <warren.weckesser@gmail.com>2020-05-16 13:04:17 -0400
commit00e76889d0f35de7415bf6967237351972cb44cd (patch)
tree81db35b46d5f6cfb7895587b0765067f6dfca0a9 /doc/source/user
parent892a3fa83ca8ef2db9d896efb482f88ad21d6b5b (diff)
downloadnumpy-00e76889d0f35de7415bf6967237351972cb44cd.tar.gz
DOC: Update the f2py section of the "Using Python as Glue" page.
* Update the output shown for the docstrings generated by f2py.
Diffstat (limited to 'doc/source/user')
-rw-r--r--doc/source/user/c-info.python-as-glue.rst37
1 files changed, 22 insertions, 15 deletions
diff --git a/doc/source/user/c-info.python-as-glue.rst b/doc/source/user/c-info.python-as-glue.rst
index 201bd8417..6904a2fec 100644
--- a/doc/source/user/c-info.python-as-glue.rst
+++ b/doc/source/user/c-info.python-as-glue.rst
@@ -171,14 +171,16 @@ information about how the module method may be called::
>>> import add
>>> print(add.zadd.__doc__)
- zadd - Function signature:
- zadd(a,b,c,n)
- Required arguments:
- a : input rank-1 array('D') with bounds (*)
- b : input rank-1 array('D') with bounds (*)
- c : input rank-1 array('D') with bounds (*)
- n : input int
+ zadd(a,b,c,n)
+ Wrapper for ``zadd``.
+
+ Parameters
+ ----------
+ a : input rank-1 array('D') with bounds (*)
+ b : input rank-1 array('D') with bounds (*)
+ c : input rank-1 array('D') with bounds (*)
+ n : input int
Improving the basic interface
-----------------------------
@@ -249,18 +251,23 @@ The new interface has docstring::
>>> import add
>>> print(add.zadd.__doc__)
- zadd - Function signature:
- c = zadd(a,b)
- Required arguments:
- a : input rank-1 array('D') with bounds (n)
- b : input rank-1 array('D') with bounds (n)
- Return objects:
- c : rank-1 array('D') with bounds (n)
+ c = zadd(a,b)
+
+ Wrapper for ``zadd``.
+
+ Parameters
+ ----------
+ a : input rank-1 array('D') with bounds (n)
+ b : input rank-1 array('D') with bounds (n)
+
+ Returns
+ -------
+ c : rank-1 array('D') with bounds (n)
Now, the function can be called in a much more robust way::
>>> add.zadd([1,2,3],[4,5,6])
- array([ 5.+0.j, 7.+0.j, 9.+0.j])
+ array([5.+0.j, 7.+0.j, 9.+0.j])
Notice the automatic conversion to the correct format that occurred.