Skip to content

Commit

Permalink
tests: Replace n with at_most in AgentSet select
Browse files Browse the repository at this point in the history
  • Loading branch information
EwoutH committed Sep 26, 2024
1 parent 8836a05 commit 4292d38
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/test_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,13 @@ def test_function(agent):
assert len(agentset.select(at_most=1)) == 1 # Select 1 agent

assert len(agentset.select(test_function)) == 5
assert len(agentset.select(test_function, n=2)) == 2
assert len(agentset.select(test_function, at_most=2)) == 2
assert len(agentset.select(test_function, inplace=True)) == 5
assert agentset.select(inplace=True) == agentset
assert all(a1 == a2 for a1, a2 in zip(agentset.select(), agentset))
assert all(a1 == a2 for a1, a2 in zip(agentset.select(n=5), agentset[:5]))
assert all(a1 == a2 for a1, a2 in zip(agentset.select(at_most=5), agentset[:5]))

assert len(agentset.shuffle(inplace=False).select(n=5)) == 5
assert len(agentset.shuffle(inplace=False).select(at_most=5)) == 5

def test_function(agent):
return agent.unique_id
Expand Down Expand Up @@ -301,7 +301,7 @@ def remove_function(agent):
def test_agentset_get():
"""Test AgentSet.get."""
model = Model()
_ = [TestAgent(model) for i in range(10)]
[TestAgent(model) for _ in range(10)]

agentset = model.agents

Expand Down

0 comments on commit 4292d38

Please sign in to comment.