-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Description
Originally posted in #19307 (comment) (slightly edited):
I'm seeing a bunch of new errors pop up when running stubtest on scipy-stubs using mypy master (ffe2db8).
All errors are seem to be related to __cinit__ Cython methods:
scipy.io.matlab._mio5_utils.VarReader5(not public api)- scipy: https://github.com/scipy/scipy/blob/7d48c99615028935614943007fe61ce361dddebf/scipy/io/matlab/_mio5_utils.pyx#L169
- scipy-stubs: https://github.com/scipy/scipy-stubs/blob/0ecf76215d341637211681567c22aefdd210de8f/scipy-stubs/io/matlab/_mio5_utils.pyi#L53
scipy.stats._unuran.unuran_wrapper.TransformedDensityRejection, re-exported asscipy.stats.sampling.TransformedDensityRejection- scipy: https://github.com/scipy/scipy/blob/7d48c99615028935614943007fe61ce361dddebf/scipy/stats/_unuran/unuran_wrapper.pyx#L815-L825
- scipy-stubs: https://github.com/scipy/scipy-stubs/blob/0ecf76215d341637211681567c22aefdd210de8f/scipy-stubs/stats/_unuran/unuran_wrapper.pyi#L64-L77
scipy.stats._unuran.unuran_wrapper.SimpleRatioUniforms, re-exported asscipy.stats.sampling.SimpleRatioUniforms- scipy: https://github.com/scipy/scipy/blob/7d48c99615028935614943007fe61ce361dddebf/scipy/stats/_unuran/unuran_wrapper.pyx#L1108-L1115
- scipy-stubs: https://github.com/scipy/scipy-stubs/blob/0ecf76215d341637211681567c22aefdd210de8f/scipy-stubs/stats/_unuran/unuran_wrapper.pyi#L89-L100
scipy.stats._unuran.unuran_wrapper.NumericalInversePolynomial, re-exported asscipy.stats.sampling.NumericalInversePolynomial- scipy: https://github.com/scipy/scipy/blob/7d48c99615028935614943007fe61ce361dddebf/scipy/stats/_unuran/unuran_wrapper.pyx#L1382-L1390
- scipy-stubs: https://github.com/scipy/scipy-stubs/blob/0ecf76215d341637211681567c22aefdd210de8f/scipy-stubs/stats/_unuran/unuran_wrapper.pyi#L103-L113
scipy.stats._unuran.unuran_wrapper.NumericalInverseHermite, re-exported asscipy.stats.sampling.NumericalInverseHermite- scipy: https://github.com/scipy/scipy/blob/7d48c99615028935614943007fe61ce361dddebf/scipy/stats/_unuran/unuran_wrapper.pyx#L1946-L1953
- scipy-stubs: https://github.com/scipy/scipy-stubs/blob/0ecf76215d341637211681567c22aefdd210de8f/scipy-stubs/stats/_unuran/unuran_wrapper.pyi#L127-L138
scipy.stats._unuran.unuran_wrapper.DiscreteAliasUrn, re-exported asscipy.stats.sampling.DiscreteAliasUrn- scipy: https://github.com/scipy/scipy/blob/7d48c99615028935614943007fe61ce361dddebf/scipy/stats/_unuran/unuran_wrapper.pyx#L2370-L2375
- scipy-stubs: https://github.com/scipy/scipy-stubs/blob/0ecf76215d341637211681567c22aefdd210de8f/scipy-stubs/stats/_unuran/unuran_wrapper.pyi#L149-L157
scipy.stats._unuran.unuran_wrapper.DiscreteGuideTable, re-exported asscipy.stats.sampling.DiscreteGuideTable- scipy: https://github.com/scipy/scipy/blob/7d48c99615028935614943007fe61ce361dddebf/scipy/stats/_unuran/unuran_wrapper.pyx#L2628-L2633
- scipy-stubs: https://github.com/scipy/scipy-stubs/blob/0ecf76215d341637211681567c22aefdd210de8f/scipy-stubs/stats/_unuran/unuran_wrapper.pyi#L160-L168
Each parameter is reported as a separate error, and aliases are counted double, which causes 75 errors to be reported here.
I must admit that I know very little about cython and the C-side of cpython, so I'm not able to see why this is happening. But the fact that these only occur in case of these __cinit__ methods is kinda sus afaik.
Oh and here are the errors: https://gist.github.com/jorenham/3d41e79607bcc1f45267acc1566833d2
This might also be relevant infomation:
>>> from scipy.stats._unuran.unuran_wrapper import TransformedDensityRejection
>>> TransformedDensityRejection.__init__.__text_signature__
'($self, /, *args, **kwargs)'So it's kinda odd that stubtest says it's def (self) at runtime, right?