Skip to content

Commit

Permalink
Fix test_visualization param bug
Browse files Browse the repository at this point in the history
  • Loading branch information
rht committed Jul 7, 2017
1 parent 92bfcf3 commit 364ad70
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion mesa/batchrunner.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ def combinations(*items):
"""
A small fix to handle dictionary type parameters in cartesian product.
"""
prepared = [(item,) if isinstance(item, Mapping) else item
prepared = [(item,) if isinstance(item, collections.Mapping) else item
for item in items]
yield from (param for param in product(*prepared))


class VariableParameterError(TypeError):
MESSAGE = ('variable_parameters must map a name to a sequence of values. '
'These parameters were given with non-sequence values: {}')
Expand Down
2 changes: 1 addition & 1 deletion tests/test_visualization.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def __init__(self, width, height, key1=103, key2=104):
self.grid = Grid(width, height, torus=True)

for (c, x, y) in self.grid.coord_iter():
a = MockAgent(x + y * 100, x * y * 3)
a = MockAgent(x + y * 100, self, x * y * 3)
self.grid.place_agent(a, (x, y))
self.schedule.add(a)

Expand Down

0 comments on commit 364ad70

Please sign in to comment.