diff --git a/riptable/rt_dataset.py b/riptable/rt_dataset.py index f2f530fa..1a165385 100644 --- a/riptable/rt_dataset.py +++ b/riptable/rt_dataset.py @@ -1136,13 +1136,6 @@ def __le__(self, lhs): def __lt__(self, lhs): return self._dataset_compare_check('__lt__', lhs) - eq = __eq__ - ne = __ne__ - ge = __ge__ - le = __le__ - gt = __gt__ - lt = __lt__ - # ------------------------------------------------------------ def __len__(self): # Debated October 2019 @@ -2270,14 +2263,6 @@ def abs(self) -> 'Dataset': """ return abs(self) - add = __add__ - sub = __sub__ - mul = __mul__ - div = __truediv__ - floordiv = __floordiv__ - pow = __pow__ - mod = __mod__ - @property def dtypes(self) -> Mapping[str, np.dtype]: """ diff --git a/riptable/rt_fastarray.py b/riptable/rt_fastarray.py index 43e2d987..feb772f3 100644 --- a/riptable/rt_fastarray.py +++ b/riptable/rt_fastarray.py @@ -1434,21 +1434,6 @@ def __gt__(self, other): return self._compare_check(super().__gt__,other) def __le__(self, other): return self._compare_check(super().__le__,other) def __lt__(self, other): return self._compare_check(super().__lt__,other) - eq = __eq__ - ne = __ne__ - ge = __ge__ - le = __le__ - gt = __gt__ - lt = __lt__ - - add = np.ndarray.__add__ - sub = np.ndarray.__sub__ - mul = np.ndarray.__mul__ - div = np.ndarray.__truediv__ - floordiv = np.ndarray.__floordiv__ - pow = np.ndarray.__pow__ - mod = np.ndarray.__mod__ - #--------------------------------------------------------------------------- def str_append(self, other): if self.dtype.num == other.dtype.num: diff --git a/riptable/tests/test_dataset.py b/riptable/tests/test_dataset.py index 7298d41f..680ff830 100644 --- a/riptable/tests/test_dataset.py +++ b/riptable/tests/test_dataset.py @@ -2,10 +2,8 @@ import unittest import re import keyword -import operator import pandas as pd - from collections import namedtuple import numpy as np from numpy.testing import assert_array_equal, assert_array_almost_equal @@ -2194,38 +2192,6 @@ def test_overwrite_column_with_scalar(self) -> None: assert_array_equal(col, scalar_value) -@pytest.mark.parametrize('op_name', [ - 'eq', - 'ne', - 'ge', - 'le', - 'gt', - 'lt', - 'add', - 'sub', - 'mul', - 'floordiv', -]) -def test_operator_methods(op_name): - ds = TestDataset.get_arith_dataset() - result = getattr(ds, op_name)(ds) - expected = getattr(operator, op_name)(ds, ds) - assert (result == expected).all(axis=None) - - -def test_pow_methods(): - ds = TestDataset.get_arith_dataset() - result = ds.pow(2) - expected = ds ** 2 - assert (result == expected).all(axis=None) - - -def test_mod_methods(): - ds = TestDataset.get_arith_dataset() - result = ds.mod(2) - expected = ds % 2 - assert (result == expected).all(axis=None) - @pytest.mark.parametrize('categorical', get_all_categorical_data()) def test_dataset_to_dataframe_roundtripping(categorical): diff --git a/riptable/tests/test_fastarray.py b/riptable/tests/test_fastarray.py index a99e04af..19bc6d98 100644 --- a/riptable/tests/test_fastarray.py +++ b/riptable/tests/test_fastarray.py @@ -1678,33 +1678,5 @@ def test_ctor_from_str_obj_array_with_None(as_unicode: bool) -> None: assert_array_equal(none_results, rt.full(none_results.shape, result.inv, dtype=none_results.dtype)) -@pytest.mark.parametrize('op_name', [ - 'eq', - 'ne', - 'ge', - 'le', - 'gt', - 'lt', - 'add', - 'sub', - 'mul', - 'pow', - 'floordiv', - 'mod', -]) -def test_operator_methods(op_name): - arr = rt.arange(5) - result = getattr(arr, op_name)(2) - expected = getattr(operator, op_name)(arr, 2) - assert_array_equal(result, expected) - - -def test_div_method(): - arr = rt.arange(5) - result = arr.div(2) - expected = arr / 2 - assert_array_equal(result, expected) - - if __name__ == "__main__": tester = unittest.main()