Skip to content

Conversation

@jorenham
Copy link
Member

@jorenham jorenham commented Oct 31, 2025

Same story as #30104, but for ndarray this time.

This fixes a ValueError from being raised when using inspect.signature on the ndarray methods.
The typing stubs changes are needed because stubtest is now able to "see" the actual signatures, which was causing several errors (related to pos-only parameters mostly).

This also adds a (very minimal) docstring for ndarray.dot, which was apparently missing (see the rendered docs from before and after)

@jorenham jorenham force-pushed the ndarray-method-signatures branch from 45ea941 to 3911b2f Compare October 31, 2025 19:30
@jorenham jorenham changed the title BUG, TYP: ndarray method signatures BUG, TYP: ndarray method runtime signatures Nov 1, 2025
a.__copy__()
Used if :func:`copy.copy` is called on an array. Returns a copy of the array.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it a deep copy of object arrays?

a.argmin(axis=None, out=None, *, keepdims=False)
Return indices of the minimum values along the given axis.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a single index I believe.

@charris
Copy link
Member

charris commented Nov 1, 2025

The docs could use a bit of work, but I'm going to put this in as a good start. Thanks Joren.

@charris charris merged commit 3ecfcbe into numpy:main Nov 1, 2025
80 checks passed
@jorenham jorenham deleted the ndarray-method-signatures branch November 1, 2025 21:05
charris pushed a commit that referenced this pull request Nov 6, 2025
This fixes `inspect.signature` for

- `np.random.BitGenerator`
- `np.random.Generator`
- `np.random.MT19937`
- `np.random.PCG64`
- `np.random.PCG64DXSM`
- `np.random.Philox`
- `np.random.RandomState`
- `np.random.SFC64`
- `np.random.SeedSequence`
- `np.random.bit_generator.SeedlessSeedSequence`

This also fixes a typo in `bit_generator.pxd` that accidentally defined an empty unused class `np.random.bit_generator.SeedlessSequence`.

Related to #30104, #30114, #30121, #30124, #30126, #30137, #30138, #30140, #30143, #30146, #30147, and #30155
cakedev0 pushed a commit to cakedev0/numpy that referenced this pull request Dec 5, 2025
This fixes `inspect.signature` for

- `np.random.BitGenerator`
- `np.random.Generator`
- `np.random.MT19937`
- `np.random.PCG64`
- `np.random.PCG64DXSM`
- `np.random.Philox`
- `np.random.RandomState`
- `np.random.SFC64`
- `np.random.SeedSequence`
- `np.random.bit_generator.SeedlessSeedSequence`

This also fixes a typo in `bit_generator.pxd` that accidentally defined an empty unused class `np.random.bit_generator.SeedlessSequence`.

Related to numpy#30104, numpy#30114, numpy#30121, numpy#30124, numpy#30126, numpy#30137, numpy#30138, numpy#30140, numpy#30143, numpy#30146, numpy#30147, and numpy#30155
IndifferentArea pushed a commit to IndifferentArea/numpy that referenced this pull request Dec 7, 2025
This fixes `inspect.signature` for

- `np.random.BitGenerator`
- `np.random.Generator`
- `np.random.MT19937`
- `np.random.PCG64`
- `np.random.PCG64DXSM`
- `np.random.Philox`
- `np.random.RandomState`
- `np.random.SFC64`
- `np.random.SeedSequence`
- `np.random.bit_generator.SeedlessSeedSequence`

This also fixes a typo in `bit_generator.pxd` that accidentally defined an empty unused class `np.random.bit_generator.SeedlessSequence`.

Related to numpy#30104, numpy#30114, numpy#30121, numpy#30124, numpy#30126, numpy#30137, numpy#30138, numpy#30140, numpy#30143, numpy#30146, numpy#30147, and numpy#30155
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants