Skip to content

DOC: match tensordot parameter name to its docstring#31543

Open
Carreau wants to merge 1 commit into
numpy:mainfrom
Carreau:doc-tensordot
Open

DOC: match tensordot parameter name to its docstring#31543
Carreau wants to merge 1 commit into
numpy:mainfrom
Carreau:doc-tensordot

Conversation

@Carreau
Copy link
Copy Markdown
Contributor

@Carreau Carreau commented May 31, 2026

This should not be a change of API as the parameters are positional only because of the /,

It just happens that the parameter in the docstrings are a and b, and so for example in IPython; using ? with have them mismatch.

Also adds a blank line just before the Return section in the docstringstrings as I belie it is the norm.

(I'm not skipping CI just in case because I do touch a function signature).

AI Disclosure

No AI tools used

This should not be a change of API as the parameters are positional only
because of the `/`,

It just happens that the parameter in the docstrings are `a` and `b`,
and so for example in IPython; using `?` with have them mismatch.

Also adds a blank line just before the `Return` section in the
docstringstrings as I belie it is the norm.

(I'm not skipping CI just in case because I do touch a function
signature).
@Carreau Carreau changed the title DOC: match tensordot parameter name to it's doc DOC: match tensordot parameter name to its docstring May 31, 2026
@ngoldbaum
Copy link
Copy Markdown
Member

The CI failures are real:

$ /opt/hostedtoolcache/Python/3.12.13/x64/bin/python -P -c 'import numpy'
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/home/runner/work/numpy/numpy/build-install/usr/lib/python3.12/site-packages/numpy/__init__.py", line 454, in <module>
      from . import lib, matrixlib as _mat
    File "/home/runner/work/numpy/numpy/build-install/usr/lib/python3.12/site-packages/numpy/lib/__init__.py", line 18, in <module>
      from . import (
    File "/home/runner/work/numpy/numpy/build-install/usr/lib/python3.12/site-packages/numpy/lib/_arraypad_impl.py", line 10, in <module>
      from numpy.lib._index_tricks_impl import ndindex
    File "/home/runner/work/numpy/numpy/build-install/usr/lib/python3.12/site-packages/numpy/lib/_index_tricks_impl.py", line 8, in <module>
      import numpy.matrixlib as matrixlib
    File "/home/runner/work/numpy/numpy/build-install/usr/lib/python3.12/site-packages/numpy/matrixlib/__init__.py", line 4, in <module>
      from . import defmatrix
    File "/home/runner/work/numpy/numpy/build-install/usr/lib/python3.12/site-packages/numpy/matrixlib/defmatrix.py", line 13, in <module>
      from numpy.linalg import matrix_power
    File "/home/runner/work/numpy/numpy/build-install/usr/lib/python3.12/site-packages/numpy/linalg/__init__.py", line 87, in <module>
      from . import _linalg
    File "/home/runner/work/numpy/numpy/build-install/usr/lib/python3.12/site-packages/numpy/linalg/_linalg.py", line 3407, in <module>
      @array_function_dispatch(_tensordot_dispatcher)
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/runner/work/numpy/numpy/build-install/usr/lib/python3.12/site-packages/numpy/_core/overrides.py", line 148, in decorator
      verify_matching_signatures(implementation, dispatcher)
    File "/home/runner/work/numpy/numpy/build-install/usr/lib/python3.12/site-packages/numpy/_core/overrides.py", line 99, in verify_matching_signatures
      raise RuntimeError(f'implementation and dispatcher for {implementation} have '
  RuntimeError: implementation and dispatcher for <function tensordot at 0x7f40c8fbb4c0> have different function signatures

@jorenham
Copy link
Copy Markdown
Member

jorenham commented Jun 3, 2026

Why not just change the parameter names in the docstring?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants