Skip to content

Commit

Permalink
TST: simplify a table test (astropy#16655)
Browse files Browse the repository at this point in the history
  • Loading branch information
neutrinoceros authored Jul 2, 2024
1 parent 13d314c commit d2b5630
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions astropy/table/tests/test_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -636,11 +636,6 @@ def test_column_filter():
Table groups filtering
"""

def all_positive(column):
if np.any(column < 0):
return False
return True

# Negative value in 'a' column should not filter because it is a key col
t = Table.read(
[
Expand All @@ -658,7 +653,7 @@ def all_positive(column):
format="ascii",
)
tg = t.group_by("a")
c2 = tg["c"].groups.filter(all_positive)
c2 = tg["c"].groups.filter(lambda column: np.all(column >= 0))
assert len(c2.groups) == 3
assert c2.groups[0].pformat() == [" c ", "---", "7.0", "5.0"]
assert c2.groups[1].pformat() == [" c ", "---", "0.0"]
Expand Down

0 comments on commit d2b5630

Please sign in to comment.