Skip to content

Commit

Permalink
Black clean up on examples.
Browse files Browse the repository at this point in the history
  • Loading branch information
jackiekazil committed May 23, 2021
1 parent c27dcc1 commit 17315ad
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion examples/bank_reserves/bank_reserves/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@


def get_num_rich_agents(model):
""" return number of rich agents"""
"""return number of rich agents"""

rich_agents = [a for a in model.schedule.agents if a.savings > model.rich_threshold]
return len(rich_agents)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def run_model(self, n):


class MoneyAgent(Agent):
""" An agent with fixed initial wealth."""
"""An agent with fixed initial wealth."""

def __init__(self, unique_id, model):
super().__init__(unique_id, model)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def run_model(self, n):


class MoneyAgent(Agent):
""" An agent with fixed initial wealth."""
"""An agent with fixed initial wealth."""

def __init__(self, unique_id, model):
super().__init__(unique_id, model)
Expand Down
2 changes: 1 addition & 1 deletion examples/charts/charts/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@


def get_num_rich_agents(model):
""" return number of rich agents"""
"""return number of rich agents"""

rich_agents = [a for a in model.schedule.agents if a.savings > model.rich_threshold]
return len(rich_agents)
Expand Down
4 changes: 2 additions & 2 deletions examples/pd_grid/pd_grid/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


class PDAgent(Agent):
""" Agent member of the iterated, spatial prisoner's dilemma model. """
"""Agent member of the iterated, spatial prisoner's dilemma model."""

def __init__(self, pos, model, starting_move=None):
"""
Expand All @@ -28,7 +28,7 @@ def isCooroperating(self):
return self.move == "C"

def step(self):
""" Get the neighbors' moves, and change own move accordingly. """
"""Get the neighbors' moves, and change own move accordingly."""
neighbors = self.model.grid.get_neighbors(self.pos, True, include_center=True)
best_neighbor = max(neighbors, key=lambda a: a.score)
self.next_move = best_neighbor.move
Expand Down
4 changes: 2 additions & 2 deletions examples/pd_grid/pd_grid/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@


class PdGrid(Model):
""" Model class for iterated, spatial prisoner's dilemma model. """
"""Model class for iterated, spatial prisoner's dilemma model."""

schedule_types = {
"Sequential": BaseScheduler,
Expand Down Expand Up @@ -60,6 +60,6 @@ def step(self):
self.datacollector.collect(self)

def run(self, n):
""" Run the model for n steps. """
"""Run the model for n steps."""
for _ in range(n):
self.step()
2 changes: 1 addition & 1 deletion examples/schelling/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class Schelling(Model):
"""

def __init__(self, height=20, width=20, density=0.8, minority_pc=0.2, homophily=3):
""""""
""" """

self.height = height
self.width = width
Expand Down

0 comments on commit 17315ad

Please sign in to comment.