diff options
| author | Stephan Hoyer <shoyer@gmail.com> | 2018-10-26 08:27:54 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-10-26 08:27:54 -0700 |
| commit | fbc3ad69d2396fc5edbb2f145c82965756185f82 (patch) | |
| tree | cccb607a97f06146613946983fc2aa7bf0ddfabf /numpy/lib/index_tricks.py | |
| parent | 1b8996e9477f38c8ced522c85df9ab9d73fcd339 (diff) | |
| parent | 3debe9772ea1b68d997dba3440929a467ad11c52 (diff) | |
| download | numpy-fbc3ad69d2396fc5edbb2f145c82965756185f82.tar.gz | |
Merge branch 'master' into fix-overloaded-repr
Diffstat (limited to 'numpy/lib/index_tricks.py')
| -rw-r--r-- | numpy/lib/index_tricks.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/numpy/lib/index_tricks.py b/numpy/lib/index_tricks.py index 06bb54bc1..ff2e00d3e 100644 --- a/numpy/lib/index_tricks.py +++ b/numpy/lib/index_tricks.py @@ -1,5 +1,6 @@ from __future__ import division, absolute_import, print_function +import functools import sys import math @@ -9,14 +10,17 @@ from numpy.core.numeric import ( ) from numpy.core.numerictypes import find_common_type, issubdtype -from . import function_base import numpy.matrixlib as matrixlib from .function_base import diff from numpy.core.multiarray import ravel_multi_index, unravel_index -from numpy.core.overrides import array_function_dispatch +from numpy.core import overrides, linspace from numpy.lib.stride_tricks import as_strided +array_function_dispatch = functools.partial( + overrides.array_function_dispatch, module='numpy') + + __all__ = [ 'ravel_multi_index', 'unravel_index', 'mgrid', 'ogrid', 'r_', 'c_', 's_', 'index_exp', 'ix_', 'ndenumerate', 'ndindex', 'fill_diagonal', @@ -200,9 +204,6 @@ class nd_grid(object): else: return _nx.arange(start, stop, step) - def __len__(self): - return 0 - class MGridClass(nd_grid): """ @@ -344,7 +345,7 @@ class AxisConcatenator(object): step = 1 if isinstance(step, complex): size = int(abs(step)) - newobj = function_base.linspace(start, stop, num=size) + newobj = linspace(start, stop, num=size) else: newobj = _nx.arange(start, stop, step) if ndmin > 1: |
