Skip to content
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

CLN: remove Index.__inv__ , add Index.__invert__ #22336

Closed
wants to merge 1 commit into from

Conversation

toobaz
Copy link
Member

@toobaz toobaz commented Aug 14, 2018

@jreback @jorisvandenbossche suggestions on where to put a test (pandas/tests/test_arithmetic.py would seem the right place, except it only contains tests involving datetimelike) and which version to target (not sure 0.23.5 is OK)?

@toobaz toobaz added Indexing Related to indexing on series/frames, not to indexes themselves Clean labels Aug 14, 2018
@jreback
Copy link
Contributor

jreback commented Aug 14, 2018

test_arithmetic is ok, pls target 0.24

@jorisvandenbossche
Copy link
Member

which version to target (not sure 0.23.5 is OK)?

In general, if something is not a (critical) bug fix, it should never be considered for a bug fix release (and certainly not something that is more an API clean-up)

@jorisvandenbossche
Copy link
Member

something that is more an API clean-up

Speaking of which, shouldn't we rather deprecate this first before removing?

@jorisvandenbossche
Copy link
Member

shouldn't we rather deprecate this first before removing?

OK, didn't yet read your issue, so missed that ~ is currently not working. Then it is fine removing it without deprecation.

@codecov
Copy link

codecov bot commented Aug 14, 2018

Codecov Report

❗ No coverage uploaded for pull request base (master@cf70d11). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master   #22336   +/-   ##
=========================================
  Coverage          ?   92.08%           
=========================================
  Files             ?      169           
  Lines             ?    50704           
  Branches          ?        0           
=========================================
  Hits              ?    46689           
  Misses            ?     4015           
  Partials          ?        0
Flag Coverage Δ
#multiple 90.48% <ø> (?)
#single 42.33% <ø> (?)
Impacted Files Coverage Δ
pandas/core/indexes/base.py 96.43% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cf70d11...975e634. Read the comment docs.

@codecov
Copy link

codecov bot commented Aug 14, 2018

Codecov Report

Merging #22336 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #22336   +/-   ##
=======================================
  Coverage   92.05%   92.05%           
=======================================
  Files         169      169           
  Lines       50709    50709           
=======================================
  Hits        46679    46679           
  Misses       4030     4030
Flag Coverage Δ
#multiple 90.46% <100%> (ø) ⬆️
#single 42.25% <100%> (ø) ⬆️
Impacted Files Coverage Δ
pandas/core/indexes/base.py 96.43% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cf70d11...72ebc5d. Read the comment docs.

@toobaz toobaz force-pushed the remove_index_inv_22335 branch from 975e634 to 72ebc5d Compare August 14, 2018 14:46
@toobaz toobaz changed the title CLN: remove Index.__inv__ CLN: remove Index.__inv__ , add Index.__invert__ Aug 14, 2018
@toobaz
Copy link
Member Author

toobaz commented Aug 14, 2018

@jreback @jorisvandenbossche while I was at it, given that this is going to 0.24 anyway, I thought it wouldn't harm to actually enable __invert__, consistently with the case of Series.

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.

can you also check that the ops are correctly defined in pandas/core/arrays/base.py (for EA arrays).


class TestNumericOps(object):

@pytest.mark.parametrize('opname', ['neg', 'pos', 'abs', 'inv', 'invert'])
Copy link
Contributor

Choose a reason for hiding this comment

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

can you add this in conftest as a fixture (unary_op_fixtures)?


if opname == 'inv':
# GH 22335 - 'inv' was wrong and was removed
pytest.raises(AttributeError, call_method)
Copy link
Contributor

Choose a reason for hiding this comment

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

make these if/elseif, then don't need the return (put the final clause in the else)

Copy link
Member

@jorisvandenbossche jorisvandenbossche left a comment

Choose a reason for hiding this comment

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

Apart from Jeff's comments, looks good

@jreback
Copy link
Contributor

jreback commented Aug 23, 2018

@toobaz if you can rebase and check extension arrays

@toobaz
Copy link
Member Author

toobaz commented Aug 23, 2018

@toobaz if you can rebase and check extension arrays

@jreback I'm afraid I can do that only in September, but while I'm at it:

can you add this in conftest as a fixture (unary_op_fixtures)?

In the general pandas/conftest.py ?

can you also check that the ops are correctly defined in pandas/core/arrays/base.py (for EA arrays).

Do you mean adding EA arrays to box fixture? Manually or in some automated way?

(In any case, if some tests fail I would defer to another PR)

@jreback
Copy link
Contributor

jreback commented Nov 4, 2018

closing as stale. if you want to continue, pls merge master and re-open.

@jreback jreback closed this Nov 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Clean Indexing Related to indexing on series/frames, not to indexes themselves
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove Index.__inv__
3 participants