Skip to content

Commit

Permalink
Skip numpy 1.25 dispatch functions
Browse files Browse the repository at this point in the history
  • Loading branch information
guyer committed Aug 10, 2023
1 parent d5515e1 commit 961ca49
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,10 +316,21 @@
def skip_numpy_not_numerix(app, what, name, obj, skip, options):
import types
import numpy
if type(obj) in [types.FunctionType,

screen_types = [types.FunctionType,
types.BuiltinFunctionType,
type(numpy.dtype),
type]:
type]

try:
# NumPy 1.25 changed how dispatching works
# which makes many numpy functions not Python functions
# https://github.com/numpy/numpy/pull/23020
screen_types.append(numpy.core._multiarray_umath._ArrayFunctionDispatcher)
except:
pass

if type(obj) in screen_types:
module = getattr(obj, "__module__", "")
if module is None:
module = ""
Expand Down

0 comments on commit 961ca49

Please sign in to comment.