(array)
| 772 | |
| 773 | |
| 774 | def test_groupby_reduce_dimension_error(array) -> None: |
| 775 | grouped = array.groupby("y") |
| 776 | # assert_identical(array, grouped.mean()) |
| 777 | |
| 778 | with pytest.raises(ValueError, match=r"cannot reduce over dimensions"): |
| 779 | grouped.mean("huh") |
| 780 | |
| 781 | with pytest.raises(ValueError, match=r"cannot reduce over dimensions"): |
| 782 | grouped.mean(("x", "y", "asd")) |
| 783 | |
| 784 | assert_identical(array.mean("x"), grouped.reduce(np.mean, "x")) |
| 785 | assert_allclose(array.mean(["x", "z"]), grouped.reduce(np.mean, ["x", "z"])) |
| 786 | |
| 787 | grouped = array.groupby("y") |
| 788 | assert_identical(array, grouped.mean()) |
| 789 | |
| 790 | assert_identical(array.mean("x"), grouped.reduce(np.mean, "x")) |
| 791 | assert_allclose(array.mean(["x", "z"]), grouped.reduce(np.mean, ["x", "z"])) |
| 792 | |
| 793 | |
| 794 | def test_groupby_multiple_string_args(array) -> None: |
nothing calls this directly
no test coverage detected
searching dependent graphs…