-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
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
use fused types for reshape #22454
use fused types for reshape #22454
Conversation
I know very little of Cython (or fused), but looked up in the docs, and saw this warning
Are we sure this is mature enough? |
This is a reasonable concern. The docs don't say what version that warning was added in, but later on that page it suggests that the feature was available in 0.20.0 (... I think) in which case its been around for awhile. In porting the tempita functions one-by-one I am finding a few places where there might be bugs, but I'm not at all ready to rule out the possibility that the problems are on my end. Even if we don't go in this direction, hopefully we can produce some good bug reports for cython. In my experience they've been very responsive/helpful. |
Yeah, but my concern is if bugs in pandas' behaviour originates from Cython, then we might get situations where:
which would be annoying and maybe a bit unstable. This could also happen from other bugs in cython, but the risk is probably greater for the fused API because it is declared not bug-free by the cython team... I don't have the ability to make a recommendation on this, but take it as a thing to consider and check for. Maybe consult with the Cython team whether fused types can be considered stable now? |
Codecov Report
@@ Coverage Diff @@
## master #22454 +/- ##
=========================================
Coverage ? 92.04%
=========================================
Files ? 169
Lines ? 50773
Branches ? 0
=========================================
Hits ? 46734
Misses ? 4039
Partials ? 0
Continue to review full report at Codecov.
|
@scoder : Hi, I noticed that you are one of the main commiters to the Cython repository, and we had a question regarding fused types. We here at Happy to formally open an issue if that is preferred (this is more of a usage question, hence the "cold" mention for lack of a better term). Thanks! |
Thanks for asking, I removed that note from the docs. |
@scoder : Thanks for the timely reply! Greatly appreciated. @topper-123 : Does that response alleviate your concerns? |
👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
cc @jreback
cdef: | ||
Py_ssize_t i, j, w, nulls, s, offset | ||
|
||
if reshape_t is not object: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what if we make the inner a function instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No dice; we'd need a "nogil" version and a not-nogil version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think like long-term cython may implement a feature discussed in #22452 that may let us clear this up further. For now this is much more readable than the existing tempita implementation.
@jreback gentle ping |
ok this is fine (rebase the other fused impls after this merge). |
git diff upstream/master -u -- "*.py" | flake8 --diff