Skip to content

REF/TYP: indexes #40330

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

Merged
merged 12 commits into from
Mar 9, 2021
Merged

REF/TYP: indexes #40330

merged 12 commits into from
Mar 9, 2021

Conversation

jbrockmendel
Copy link
Member

The only non-trivial change here is changing _id from _id = _Identity(object) to _id = object(), which I found in profiling (#40171 (comment)) makes a non-trivial difference as the non-cython performance inches closer to the cython performance.

Share DTI/TDI/PI's _simple_new with Categorical.

Simplify DTI/TDI __contains__

Annotations.

Docstring follow-up to #40241

Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm ping on green

except (KeyError, TypeError, ValueError):
return False
return bool(
is_scalar(res) or isinstance(res, slice) or (is_list_like(res) and len(res))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is some crazy condition, good to remove it

@jreback jreback added Index Related to the Index class or subclasses Typing type annotations, mypy/pyright type checking labels Mar 9, 2021
@jreback jreback added this to the 1.3 milestone Mar 9, 2021
@jreback
Copy link
Contributor

jreback commented Mar 9, 2021

The only non-trivial change here is changing _id from _id = _Identity(object) to _id = object(), which I found in profiling (#40171 (comment)) makes a non-trivial difference as the non-cython performance inches closer to the cython performance.

what kind of gains here?

@jreback
Copy link
Contributor

jreback commented Mar 9, 2021

hmm, the azure checks are not running. odd

@jbrockmendel
Copy link
Member Author

what kind of gains here?

on the benchmark ive been using, _reset_identity is about 2.4% of the runtime, which this cuts to 1%

@jreback jreback merged commit 3570151 into pandas-dev:master Mar 9, 2021
@jreback
Copy link
Contributor

jreback commented Mar 9, 2021

thanks @jbrockmendel

@jbrockmendel jbrockmendel deleted the share branch March 9, 2021 21:15
jbrockmendel added a commit to jbrockmendel/pandas that referenced this pull request Mar 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Index Related to the Index class or subclasses Typing type annotations, mypy/pyright type checking
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants