summaryrefslogtreecommitdiff
path: root/numpy/lib/histograms.py
diff options
context:
space:
mode:
authorStephan Hoyer <shoyer@google.com>2018-11-13 09:38:07 -0800
committerStephan Hoyer <shoyer@google.com>2018-11-13 20:24:31 -0800
commit4d24bbda32d133d51940b0691bd9b428d4198eaa (patch)
treec018ac1ada700494f1bb404a8ae9f1346720ebfe /numpy/lib/histograms.py
parentcd39348e8593dc2b41e2516fbdd8a69b0f0bda6e (diff)
downloadnumpy-4d24bbda32d133d51940b0691bd9b428d4198eaa.tar.gz
ENH: set correct __module__ for objects in numpy's public API
Fixes GH-12271 Tests verify that everything in ``dir(numpy)`` either has ``__module__`` set to ``'numpy'``, or appears in an explicit whitelist of undocumented functions and exported bulitins. These should eventually be documented or removed. I also identified a handful of functions for which I had accidentally not setup dispatch for with ``__array_function__`` before, because they were listed under "ndarray methods" in ``_add_newdocs.py``. I guess that should be a lesson in trusting code comments :).
Diffstat (limited to 'numpy/lib/histograms.py')
-rw-r--r--numpy/lib/histograms.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/numpy/lib/histograms.py b/numpy/lib/histograms.py
index 1ff25b81f..06b30f978 100644
--- a/numpy/lib/histograms.py
+++ b/numpy/lib/histograms.py
@@ -3,15 +3,19 @@ Histogram-related functions
"""
from __future__ import division, absolute_import, print_function
+import functools
import operator
import warnings
import numpy as np
from numpy.compat.py3k import basestring
-from numpy.core.overrides import array_function_dispatch
+from numpy.core import overrides
__all__ = ['histogram', 'histogramdd', 'histogram_bin_edges']
+array_function_dispatch = functools.partial(
+ overrides.array_function_dispatch, module='numpy')
+
# range is a keyword argument to many functions, so save the builtin so they can
# use it.
_range = range