-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
clarify redirection in ops #19346
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
clarify redirection in ops #19346
Conversation
Codecov Report
@@ Coverage Diff @@
## master #19346 +/- ##
==========================================
+ Coverage 91.57% 91.58% +0.01%
==========================================
Files 150 150
Lines 48702 48711 +9
==========================================
+ Hits 44597 44611 +14
+ Misses 4105 4100 -5
Continue to review full report at Codecov.
|
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. some minor style comments. any idea what masker is for, can remove?
pandas/core/ops.py
Outdated
equiv = typ + ' ' + op_desc['op'] + ' other' | ||
|
||
if typ == 'series': | ||
doc = _flex_doc_SERIES % (op_desc['desc'], op_name, equiv, |
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.
pass these as .format()
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.
Will do. While I'm at it I'm going to bring the Panel docstring over here too and put the docstring templates in a dedicated section of the file. Other than that nothing changing in the next push (other than addressing comments).
pandas/core/ops.py
Outdated
Parameters | ||
---------- | ||
op_name : str | ||
typ : str |
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.
give allowed values
pandas/core/ops.py
Outdated
op_desc['reverse']) | ||
elif typ == 'dataframe': | ||
doc = _flex_doc_FRAME % (op_desc['desc'], op_name, equiv, | ||
op_desc['reverse']) |
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.
else raise an AssertionError
pandas/core/ops.py
Outdated
def _flex_comp_method_FRAME(op, name, str_rep=None, default_axis='columns', | ||
masker=False): | ||
def _flex_comp_method_FRAME(op, name, str_rep=None, default_axis='columns'): | ||
# Masker unused for now |
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 you removed masker elsewhere? remove the comment
pandas/core/ops.py
Outdated
""" | ||
Wrapper function for Series arithmetic operations, to avoid | ||
code duplication. | ||
""" | ||
masker = _gen_eval_kwargs(name).get('masker', None) |
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.
this is needed? (masker)?
pandas/core/ops.py
Outdated
------- | ||
eval_kwargs : dict | ||
|
||
|
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.
extra line
It's a fill value used for Series comparisons. The only place it is used ATM is in _comp_method_SERIES, where it defaults to False and is passed as True for |
ping on green. I still have to check that the doc-strings are unchanged from previous though. |
ping |
thanks! |
core.ops involves a lot of redirection. This decreases some of that redirection (and some redundancy) by implementing functions that show the logic of how some of the args/kwargs are chosen. The goal is to make it so future debugging can be done without going through
func.im_func.func_closure[1].cell_contents.func_closure...
git diff upstream/master -u -- "*.py" | flake8 --diff