diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2018-11-14 18:08:30 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-14 18:08:30 -0600 |
commit | d1e0a43ff910e15034997b9b646b38014382fe6e (patch) | |
tree | 14970cfe5421541fdd3fe0f4e77a23101e39abb1 /numpy/lib/twodim_base.py | |
parent | 13a69b5e0fc409928dc81cdce405043e7c71cd0a (diff) | |
parent | a0833836e07aeabde98eb3cfa1a583b3dd4a9439 (diff) | |
download | numpy-d1e0a43ff910e15034997b9b646b38014382fe6e.tar.gz |
Merge pull request #12382 from shoyer/finish-set-module
ENH: set correct __module__ for objects in numpy's public API
Diffstat (limited to 'numpy/lib/twodim_base.py')
-rw-r--r-- | numpy/lib/twodim_base.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/numpy/lib/twodim_base.py b/numpy/lib/twodim_base.py index a05e68375..27d848608 100644 --- a/numpy/lib/twodim_base.py +++ b/numpy/lib/twodim_base.py @@ -10,6 +10,7 @@ from numpy.core.numeric import ( asarray, where, int8, int16, int32, int64, empty, promote_types, diagonal, nonzero ) +from numpy.core.overrides import set_module from numpy.core import overrides from numpy.core import iinfo, transpose @@ -150,6 +151,7 @@ def flipud(m): return m[::-1, ...] +@set_module('numpy') def eye(N, M=None, k=0, dtype=float, order='C'): """ Return a 2-D array with ones on the diagonal and zeros elsewhere. @@ -343,6 +345,7 @@ def diagflat(v, k=0): return wrap(res) +@set_module('numpy') def tri(N, M=None, k=0, dtype=float): """ An array with ones at and below the given diagonal and zeros elsewhere. @@ -698,6 +701,7 @@ def histogram2d(x, y, bins=10, range=None, normed=None, weights=None, return hist, edges[0], edges[1] +@set_module('numpy') def mask_indices(n, mask_func, k=0): """ Return the indices to access (n, n) arrays, given a masking function. @@ -768,6 +772,7 @@ def mask_indices(n, mask_func, k=0): return nonzero(a != 0) +@set_module('numpy') def tril_indices(n, k=0, m=None): """ Return the indices for the lower-triangle of an (n, m) array. @@ -881,6 +886,7 @@ def tril_indices_from(arr, k=0): return tril_indices(arr.shape[-2], k=k, m=arr.shape[-1]) +@set_module('numpy') def triu_indices(n, k=0, m=None): """ Return the indices for the upper-triangle of an (n, m) array. |