Skip to content

CLN: organize MultiIndex indexing tests #31863

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 18 commits into from
Feb 22, 2020

Conversation

jbrockmendel
Copy link
Member

No description provided.

Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

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

minor nits

import pytest

import pandas._testing as tm
from pandas.core.indexes.api import Index, MultiIndex


def _gen_mi():
# a MultiIndex used to test the general functionality of the
Copy link
Member

Choose a reason for hiding this comment

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

I think "general functionality" is mistakenly repeated twice

Copy link
Member Author

Choose a reason for hiding this comment

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

thanks, will update

# general functionality of this object

# See Also: tests.multi.conftest.idx
major_axis = Index(["foo", "bar", "baz", "qux"])
Copy link
Member

Choose a reason for hiding this comment

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

Can you alternately just construct the mi from tuples? I think would be more readable that way

Copy link
Member Author

Choose a reason for hiding this comment

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

This is how it is constructd in the other conftest

@WillAyd WillAyd added the Testing pandas testing functions or related to the test suite label Feb 11, 2020
@jreback jreback added this to the 1.1 milestone Feb 17, 2020
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.

seems ok, but is there a reason to use the class based structure rather than simply splitting to modules? (and/or putting in existing modules)

e.g. TestSliceLocs we already have test_slice.py (haven't looked closely, but for example)

@jbrockmendel
Copy link
Member Author

but is there a reason to use the class based structure rather than simply splitting to modules? (and/or putting in existing modules)

habit, mostly. for some stuff its nice to organize tests within a module

@jreback jreback merged commit 5ed1a0b into pandas-dev:master Feb 22, 2020
@jreback
Copy link
Contributor

jreback commented Feb 22, 2020

thanks

@jbrockmendel jbrockmendel deleted the ref-mi-tests branch February 22, 2020 16:38
roberthdevries pushed a commit to roberthdevries/pandas that referenced this pull request Mar 2, 2020
* implement test_take

* move test_take, organize tests

* cleanup

* remove unused imports

* isort fixup

* typo fixup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants