Replies: 1 comment 2 replies
-
|
Hmm, the stubs seem to require that So this isn't your fault; the stubs are incorrect here. Thanks for reporting! |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I'm using scipy-stubs and I'm new to optype. The following call of newton is flagged by basedpyright in strict mode:
I gives
Looking at newton's doc and in practice,
funcaccepts ndarray of floats. What am I doing wrong ?Looking at
scipy.optimize.newtontyping, I see thatfunccan be a generic callable_Fun1Dwith a type variable named_ToFloatT. I'm not sure to understand it entirely but it seems that basedpyright does not find an appropriate overload and defaults_ToFloatTtoToFloatwhich is incompatible withArrayND[np.float64]. Is my understanding correct ? In addition I don't understand why arguments areonp.Array1D[np.float64]instead ofArrayND? I feel like I'm missing something.How would you type this basic example ?
Beta Was this translation helpful? Give feedback.
All reactions