Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] authored and rht committed Feb 7, 2023
1 parent cd7b732 commit a91567b
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 12 deletions.
1 change: 0 additions & 1 deletion mesa/batchrunner.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,6 @@ def _prepare_report_table(self, vars_dict, extra_cols=None):
ordered.sort_values(by="Run", inplace=True)
if self._include_fixed:
for param, val in self.fixed_parameters.items():

# avoid error when val is an iterable
vallist = [val for i in range(ordered.shape[0])]
ordered[param] = vallist
Expand Down
1 change: 0 additions & 1 deletion mesa/datacollection.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ def get_reports(agent):
def collect(self, model):
"""Collect all the data for the given model object."""
if self.model_reporters:

for var, reporter in self.model_reporters.items():
# Check if Lambda operator
if isinstance(reporter, types.LambdaType):
Expand Down
4 changes: 0 additions & 4 deletions mesa/space.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,6 @@ def get_neighborhood(

for dx in range(-x_radius, x_radius + 1 - kx):
for dy in range(-y_radius, y_radius + 1 - ky):

if not moore and abs(dx) + abs(dy) > radius:
continue

Expand All @@ -309,7 +308,6 @@ def get_neighborhood(

for nx in x_range:
for ny in y_range:

if not moore and abs(nx - x) + abs(ny - y) > radius:
continue

Expand Down Expand Up @@ -708,12 +706,10 @@ def get_neighborhood(
coordinates = set()

while radius > 0:

level_size = len(queue)
radius -= 1

for i in range(level_size):

x, y = queue.pop()

if x % 2 == 0:
Expand Down
1 change: 0 additions & 1 deletion mesa/visualization/UserParam.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ def __init__(
choices=None,
description=None,
):

warn(
"UserSettableParameter is deprecated in favor of UserParam objects "
"such as Slider, Checkbox, Choice, StaticText, NumberInput. "
Expand Down
1 change: 0 additions & 1 deletion tests/test_grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ def test_agent_remove(self):
assert self.grid[x][y] is None

def test_swap_pos(self):

# Swap agents positions
agent_a, agent_b = list(filter(None, self.grid))[:2]
pos_a = agent_a.pos
Expand Down
5 changes: 1 addition & 4 deletions tests/test_visualization.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@ class MockModel(Model):
"""Test model for testing"""

def __init__(self, width, height, key1=103, key2=104):

self.width = width
self.height = height
self.key1 = (key1,)
self.key2 = key2
self.schedule = SimultaneousActivation(self)
self.grid = MultiGrid(width, height, torus=True)

for (c, x, y) in self.grid.coord_iter():
for c, x, y in self.grid.coord_iter():
a = MockAgent(x + y * 100, self, x * y * 3)
self.grid.place_agent(a, (x, y))
self.schedule.add(a)
Expand All @@ -47,7 +46,6 @@ def portrayal(self, cell):
}

def setUp(self):

self.user_params = {
"width": 1,
"height": 1,
Expand All @@ -67,7 +65,6 @@ def setUp(self):
)

def test_canvas_render_model_state(self):

test_portrayal = self.portrayal(None)
test_grid_state = defaultdict(list)
test_grid_state[test_portrayal["Layer"]].append(test_portrayal)
Expand Down

0 comments on commit a91567b

Please sign in to comment.