-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
BUG: memoryview error with Cython 0.29.31 #16718
Comments
@jjerphan this might interest you. |
This is due to the changes here cython/cython#4849 and the associated issue was cython/cython#4798 |
Thanks @tupui. It looks like the problem is that |
oh I see. Do we then just need to put this function outside? |
At the moment, I'm mostly speculating, so take this with a grain of salt...
If my understanding of the problem is correct, then yes, I think that would be one way to fix it. Move That might be more than necessary, however. The error message says
Maybe the "memoryview typed argument" only refers to If any Cython devs/gurus happen to stop by, maybe they can suggest the simplest fix. |
We're talking about this inner function, apparently: Line 235 in 7f941db
IIUC, it uses the outer function's memoryview arguments Cython 3.0 has a proper fix, but that's not easy to backport. Thus the error in 0.29.31. Sorry for the hassle. |
Because of a bug in Cython, the inner function weigh() (a closure in _weightedrankedtau()) cannot refer to the memoryview arguments of _weightedrankedtau(). The work-around here is to assign the arguments to local variables. Closes scipygh-16718
Thanks @scoder! |
@tupui: Thanks. scikit-learn has the same problem. I will resolve the issue there first, and I might inspect this issue then. |
Thanks @jjerphan. Warren already has a fix, I am just waiting for the CI to finish to get it in as it break all workflows. So we better fix this quick and if there are improvements to make later, we can still iterate 😃 |
The fix looks proper to me and I do not think you'll need further iterations then. |
FWIW it looks like the error message was probably overly strict with Cython and the issue is only with arguments to a |
What would be the suggestion currently? Use 1.9 RC build (doesn't seen to work)? wait for new fixes in 1.9? Or downgrade Cython? |
@xkszltl we are about to release 1.9 so if you can wait a few days that would be it. Otherwise you can use nightly builds we are making. But you might need to wait a bit until this PR gets into the nightly (not sure when is the rebuild happening). |
Actually I tried 1.9.0rc3 locally with 0.29.31 but still hit some issues (didn't look into, seems like same or similar issues as before). Does 1.9 carry extra fixes on top? |
@xkszltl It's normal as Cython 0.29.31 is the breaking release. If you want to use 1.9.0rc3 you need to use Cython 0.29.30. SciPy 1.9 will have the fix to work with Cython 0.29.31 as we just merged the fix (so after 1.9rc3 was made). |
Cython 0.29.32 has been released, which removes the error again. Sorry for the inconvenience, and thanks for reporting back the issue. |
Cython 0.29.31 was release a few hours ago and it corresponds to our CI going red.
https://github.com/cython/cython/releases/tag/0.29.31
See for instance: https://github.com/scipy/scipy/runs/7551272609?check_suite_focus=true
The text was updated successfully, but these errors were encountered: