Skip to content

CLN: BlockManager.get_slice require only slice arg #40262

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 6 commits into from
Mar 10, 2021

Conversation

jbrockmendel
Copy link
Member

@jbrockmendel jbrockmendel commented Mar 6, 2021

  • closes #xxxx
  • tests added / passed
  • Ensure all linting tests pass, see here for how to run them
  • whatsnew entry

non-slice objects are currently getting past mypy. This ensures we only get slices, will open up some optimization options.

Also did some docstring/typing cleanup in the neighborhood.

update: updated to implement Index._getitem_slice. Cuts about 10% off of the benchmark discussed in #40171 (comment) (as compared to current master, not then-master)

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.

this is quite a lot of added code paths in index, are these really all tested?

@@ -1604,14 +1609,23 @@ def _blklocs(self):
""" compat with BlockManager """
return None

def getitem_mgr(self, indexer) -> SingleBlockManager:
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't this exist for BlockManager and just be no-op?

Copy link
Member Author

Choose a reason for hiding this comment

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

its only ever used by Series

@jreback jreback added Internals Related to non-user accessible pandas implementation Refactor Internal refactoring of code labels Mar 8, 2021
@jbrockmendel
Copy link
Member Author

this is quite a lot of added code paths in index, are these really all tested?

yes

@jreback jreback added this to the 1.3 milestone Mar 9, 2021
@jreback
Copy link
Contributor

jreback commented Mar 9, 2021

ok looks fine. we have sufficient asv's to cover? (assume we do)

@jbrockmendel
Copy link
Member Author

we have sufficient asv's to cover? (assume we do)

yes. this is motivated by the one discussed in joris's libreduction PR

@jreback
Copy link
Contributor

jreback commented Mar 9, 2021

lgtm. can you rebase & ping on green.

@jbrockmendel
Copy link
Member Author

Ping

@jreback jreback merged commit 0e1a6c1 into pandas-dev:master Mar 10, 2021
@jbrockmendel jbrockmendel deleted the ref-slice branch March 10, 2021 14:46
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
Internals Related to non-user accessible pandas implementation Refactor Internal refactoring of code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants