(self)
| 6630 | # casting nan warns |
| 6631 | @pytest.mark.filterwarnings("ignore:invalid value encountered in cast") |
| 6632 | def test_unary_ops(self) -> None: |
| 6633 | ds = self.make_example_math_dataset() |
| 6634 | |
| 6635 | assert_identical(ds.map(abs), abs(ds)) |
| 6636 | assert_identical(ds.map(lambda x: x + 4), ds + 4) |
| 6637 | |
| 6638 | for func in [ |
| 6639 | lambda x: x.isnull(), |
| 6640 | lambda x: x.round(), |
| 6641 | lambda x: x.astype(int), |
| 6642 | ]: |
| 6643 | assert_identical(ds.map(func), func(ds)) |
| 6644 | |
| 6645 | assert_identical(ds.isnull(), ~ds.notnull()) |
| 6646 | |
| 6647 | # don't actually patch these methods in |
| 6648 | with pytest.raises(AttributeError): |
| 6649 | _ = ds.item |
| 6650 | with pytest.raises(AttributeError): |
| 6651 | _ = ds.searchsorted |
| 6652 | |
| 6653 | def test_dataset_array_math(self) -> None: |
| 6654 | ds = self.make_example_math_dataset() |
nothing calls this directly
no test coverage detected