Thanks to visit codestin.com
Credit goes to github.com

Skip to content

DOC: Adds documentation of functions exposed in numpy namespace #13847

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/source/reference/routines.char.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ comparison.
less_equal
greater
less
compare_chararrays

String information
------------------
Expand Down
19 changes: 19 additions & 0 deletions doc/source/reference/routines.other.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Memory ranges

shares_memory
may_share_memory
byte_bounds

Array mixins
------------
Expand All @@ -35,3 +36,21 @@ NumPy version comparison
:toctree: generated/

lib.NumpyVersion

Utility
-------

.. autosummary::
:toctree: generated/

get_include
deprecate
deprecate_with_doc

Matlab-like Functions
---------------------
.. autosummary::
:toctree: generated/

who
disp
82 changes: 1 addition & 81 deletions numpy/core/_add_newdocs.py
Original file line number Diff line number Diff line change
Expand Up @@ -3255,87 +3255,6 @@
"""))


add_newdoc('numpy.core.multiarray', 'shares_memory',
"""
shares_memory(a, b, max_work=None)

Determine if two arrays share memory

Parameters
----------
a, b : ndarray
Input arrays
max_work : int, optional
Effort to spend on solving the overlap problem (maximum number
of candidate solutions to consider). The following special
values are recognized:

max_work=MAY_SHARE_EXACT (default)
The problem is solved exactly. In this case, the function returns
True only if there is an element shared between the arrays.
max_work=MAY_SHARE_BOUNDS
Only the memory bounds of a and b are checked.

Raises
------
numpy.TooHardError
Exceeded max_work.

Returns
-------
out : bool

See Also
--------
may_share_memory

Examples
--------
>>> np.may_share_memory(np.array([1,2]), np.array([5,8,9]))
False

""")


add_newdoc('numpy.core.multiarray', 'may_share_memory',
"""
may_share_memory(a, b, max_work=None)

Determine if two arrays might share memory

A return of True does not necessarily mean that the two arrays
share any element. It just means that they *might*.

Only the memory bounds of a and b are checked by default.

Parameters
----------
a, b : ndarray
Input arrays
max_work : int, optional
Effort to spend on solving the overlap problem. See
`shares_memory` for details. Default for ``may_share_memory``
is to do a bounds check.

Returns
-------
out : bool

See Also
--------
shares_memory

Examples
--------
>>> np.may_share_memory(np.array([1,2]), np.array([5,8,9]))
False
>>> x = np.zeros([3, 4])
>>> np.may_share_memory(x[:,0], x[:,1])
True

""")


add_newdoc('numpy.core.multiarray', 'ndarray', ('newbyteorder',
"""
arr.newbyteorder(new_order='S')
Expand Down Expand Up @@ -6997,3 +6916,4 @@ def add_newdoc_for_scalar_type(obj, fixed_aliases, doc):
>>> np.{ftype}(-.25).as_integer_ratio()
(-1, 4)
""".format(ftype=float_name)))