8000 REF: boilerplate for ops internal consistency by jbrockmendel · Pull Request #28037 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

REF: boilerplate for ops internal consistency #28037

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 57 commits into from
Nov 14, 2019
Merged
Changes from 1 commit
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
1426061
OK
jbrockmendel Aug 9, 2019
c9e99f3
OK
jbrockmendel Aug 9, 2019
f109154
Merge branch 'master' of https://github.com/pandas-dev/pandas into opcom
jbrockmendel Aug 9, 2019
2462d9b
OK
jbrockmendel Aug 9, 2019
2289a85
OK
jbrockmendel Aug 10, 2019
68bab4b
OK
jbrockmendel Aug 10, 2019
7b00b02
OK
jbrockmendel Aug 12, 2019
c776dd7
Merge branch 'master' of https://github.com/pandas-dev/pandas into opcom
jbrockmendel Aug 12, 2019
c2e9fc6
cln
jbrockmendel Aug 12, 2019
afbd04a
remove validate_for_numeric_binop
jbrockmendel Aug 12, 2019
8af29a8
Merge branch 'master' of https://github.com/pandas-dev/pandas into opcom
jbrockmendel Aug 12, 2019
f3c9c20
OK
jbrockmendel Aug 12, 2019
2c72628
delete commented-out
jbrockmendel Aug 12, 2019
d19282d
OK
jbrockmendel Aug 12, 2019
7f337d2
Merge branch 'master' of https://github.com/pandas-dev/pandas into opcom
jbrockmendel Aug 12, 2019
242d7a0
cleanup
jbrockmendel Aug 12, 2019
fc498c0
Merge branch 'master' of https://github.com/pandas-dev/pandas into opcom
jbrockmendel Aug 12, 2019
9582d43
Merge branch 'master' of https://github.com/pandas-dev/pandas into opcom
jbrockmendel Aug 13, 2019
77cbdff
Merge branch 'master' of https://github.com/pandas-dev/pandas into opcom
jbrockmendel Aug 13, 2019
d3dafed
Merge branch 'master' of https://github.com/pandas-dev/pandas into opcom
jbrockmendel Aug 13, 2019
c539b2e
Merge branch 'master' of https://github.com/pandas-dev/pandas into opcom
jbrockmendel Aug 14, 2019
9d19cdb
Merge branch 'master' of https://github.com/pandas-dev/pandas into opcom
jbrockmendel Aug 15, 2019
< 8000 code class="float-right">e65ae3b
Merge branch 'master' of https://github.com/pandas-dev/pandas into opcom
jbrockmendel Aug 15, 2019
52c8ad3
Merge branch 'master' of https://github.com/pandas-dev/pandas into opcom
jbrockmendel Aug 15, 2019
2800a9b
Merge branch 'master' of https://github.com/pandas-dev/pandas into opcom
jbrockmendel Aug 16, 2019
d33ca40
Merge branch 'master' of https://github.com/pandas-dev/pandas into opcom
jbrockmendel Aug 16, 2019
2875b3a
Merge branch 'master' of https://github.com/pandas-dev/pandas into opcom
jbrockmendel Aug 19, 2019
f84e737
Merge branch 'master' of https://github.com/pandas-dev/pandas into opcom
jbrockmendel Aug 19, 2019
6149859
revert unnecessary
jbrockmendel Aug 19, 2019
05920a1
revert
jbrockmendel Aug 19, 2019
d6adfb0
docstring
jbrockmendel Aug 19, 2019
837d728
Merge branch 'master' of https://github.com/pandas-dev/pandas into opcom
jbrockmendel Aug 19, 2019
9eb8fbc
Merge branch 'master' of https://github.com/pandas-dev/pandas into opcom
jbrockmendel Aug 19, 2019
eb583c7
Merge branch 'master' of https://github.com/pandas-dev/pandas into opcom
jbrockmendel Aug 20, 2019
9e30806
import fixup
jbrockmendel Aug 20, 2019
63d8f9c
blackify
jbrockmendel Aug 20, 2019
98f02b9
isort fixup
jbrockmendel Aug 20, 2019
f84258f
type ignore
jbrockmendel Aug 20, 2019
e3c07dd
Merge branch 'master' of https://github.com/pandas-dev/pandas into opcom
jbrockmendel Sep 3, 2019
cc36fd7
Merge branch 'master' of https://github.com/pandas-dev/pandas into opcom
jbrockmendel Sep 5, 2019
3d96ed6
Merge branch 'master' of https://github.com/pandas-dev/pandas into opcom
jbrockmendel Sep 9, 2019
66fd7cc
add str type
jbrockmendel Sep 9, 2019
f994a3b
Merge branch 'master' of https://github.com/pandas-dev/pandas into opcom
jbrockmendel Sep 15, 2019
96d4adb
Merge branch 'master' of https://github.com/pandas-dev/pandas into opcom
jbrockmendel Sep 16, 2019
85fb1c1
lint fixup
jbrockmendel Sep 16, 2019
ddc056e
Merge branch 'master' of https://github.com/pandas-dev/pandas into opcom
jbrockmendel Sep 18, 2019
6947bc0
blackify
jbrockmendel Sep 18, 2019
31e1ed2
Merge branch 'master' of https://github.com/pandas-dev/pandas into opcom
jbrockmendel Sep 23, 2019
7e7064c
Merge branch 'master' of https://github.com/pandas-dev/pandas into opcom
jbrockmendel Sep 26, 2019
69e349e
Merge branch 'master' of https://github.com/pandas-dev/pandas into opcom
jbrockmendel Sep 26, 2019
23ceb47
Merge branch 'master' of https://github.com/pandas-dev/pandas into opcom
jbrockmendel Sep 28, 2019
434686c
Merge branch 'master' of https://github.com/pandas-dev/pandas into opcom
jbrockmendel Oct 6, 2019
7e98119
Merge branch 'master' of https://github.com/pandas-dev/pandas into opcom
jbrockmendel Oct 6, 2019
d5caf5e
Merge branch 'master' of https://github.com/pandas-dev/pandas into opcom
jbrockmendel Oct 8, 2019
109699e
Merge branch 'master' of https://github.com/pandas-dev/pandas into opcom
jbrockmendel Oct 24, 2019
6136486
Merge branch 'master' of https://github.com/pandas-dev/pandas into opcom
jbrockmendel Nov 14, 2019
bc2c0d5
rename unpack_and_defer -> unpack_zerodim_and_defer
jbrockmendel Nov 14, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
OK
  • Loading branch information
jbrockmendel committed Aug 12, 2019
commit d19282d084b34066e19fc1eb47d906ce4c5b62fe
16 changes: 2 additions & 14 deletions pandas/core/indexes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,7 @@ def cmp_method(self, other):
if other.ndim > 0 and len(self) != len(other):
raise ValueError("Lengths must match to compare")

if is_object_dtype(self): # and not isinstance(self, ABCMultiIndex):
# don't pass MultiIndex
if is_object_dtype(self):
assert not isinstance(self, ABCMultiIndex)
with np.errstate(all="ignore"):
result = ops._comp_method_OBJECT_ARRAY(op, self.values, other)
Expand All @@ -120,6 +119,7 @@ def cmp_method(self, other):
if is_bool_dtype(result):
# TODO: This fails for exactly 1 test, with Int64Index and other="a" and ==
return result
#raise RuntimeError(other, op, self.dtype)
try:
return Index(result)
except TypeError:
Expand Down Expand Up @@ -5376,16 +5376,6 @@ def _maybe_update_attributes(self, attrs):
"""
return attrs

def _validate_for_numeric_unaryop(self, op, opstr):
"""
Validate if we can perform a numeric unary operation.
"""
if not self._is_numeric_dtype:
raise TypeError(
"cannot evaluate a numeric op "
"{opstr} for type: {typ}".format(opstr=opstr, typ=type(self).__name__)
)

@classmethod
def _add_numeric_methods_binary(cls):
"""
Expand Down Expand Up @@ -5417,8 +5407,6 @@ def _add_numeric_methods_unary(cls):

def _make_evaluate_unary(op, opstr):
def _evaluate_numeric_unary(self):

# self._validate_for_numeric_unaryop(op, opstr)
attrs = self._get_attributes_dict()
attrs = self._maybe_update_attributes(attrs)
return Index(op(self.values), **attrs)
Expand Down
0