-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
REF: move dispatch methods to WrappedCythonOp #41114
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
Conversation
@@ -299,6 +299,270 @@ def get_result_dtype(self, dtype: DtypeObj) -> DtypeObj: | |||
def uses_mask(self) -> bool: | |||
return self.how in self._MASKED_CYTHON_FUNCTIONS | |||
|
|||
@final |
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.
can we move WrappedCythonOps the class to a new module, maybe cython_ops.py? (can do it in this PR or pre-cursor)
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.
at some point. naming-wise i actually think it makes sense for it to be in ops.py and everything else to be somewhere else, but im not sure where that would be (the relationship between Grouper vs BaseGrouper still confuses me)
if func_uses_mask: | ||
func( | ||
result, | ||
return cy_op._ea_wrap_cython_operation( |
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.
Could we make _ea_wrap_cython_operation
and some of the other private methods called from an instance of WrappedCythonOp
public? Are there are any rules of thumb we have for private/public methods for non-user facing classes?
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.
good catch. i think before long _cython_operation itself will move, at which point it will become public
lgtm can you merge master |
Rebased + green |
This gets us most of the way towards having everything in the correct class.
The sticking point that makes this not-a-slam-dunk is that a check is removed:
This condition never holds in the tests, and the assertion would fail if it ever did. I don't have a compelling reason to remove this check other than it being inconvenient to move it to WrappedCythonOp.