Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shape-typing in scipy.interpolate.BSplines #475

Open
jorenham opened this issue Mar 11, 2025 · 0 comments
Open

shape-typing in scipy.interpolate.BSplines #475

jorenham opened this issue Mar 11, 2025 · 0 comments
Labels

Comments

@jorenham
Copy link
Collaborator

The coefficient array c is at least 1d. Its shape affects the output shape when called. E.g. when c is 1d and the BSpline instance is called with a scalar, the return type will be a 0d, and when c is 2d, the return type will be 1d.

By making BSpline generic for the shape-type of c (i.e. as _ShapeT_co: onp.AtLeast1D = onp.AtLeast1D), it becomes possible to annotate the shape-type of the __call__ return type, or at least for some of the common combinations of _ShapeT_co and x (the input to __call__).

@jorenham jorenham added scipy.interpolate stubs: improvement Improve or refactor existing annotations topic: shape-typing labels Mar 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant