Skip to content

Commit f83daff

Browse files
authored
Merge pull request #1040 from jackiekazil/main
release v0.8.9 Oro Valley
2 parents bbf1b88 + 3aee0b7 commit f83daff

File tree

18 files changed

+94
-69
lines changed

18 files changed

+94
-69
lines changed

HISTORY.rst

+27-2
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,37 @@
33
Release History
44
---------------
55

6-
7-
0.8.9 (TBD) Oro Valley
6+
0.8.9 (2020-05-22) Oro Valley
87
+++++++++++++++++++++++++++++++++++++++++++
98

109
*Note: Master branch was renamed to Main on 03/13/2021*
1110

11+
**Improvements**
12+
13+
* Master to Main change:
14+
* Docs/examples: Update links to use main instead of master as branch #1012
15+
* CI: Run on pushed to main and release branches #1011
16+
* Github Actions
17+
* GitHub Actions: run black only on ubuntu 3.8 #996
18+
* GA: Only run CI when pushed to master #974
19+
* GA: Add pypy3 #972
20+
* rename github action to "build", remove redundant flake8 check #971
21+
* GA: Run on Windows and macOS #970
22+
* Add GitHub Action for continuous integration testing #966
23+
* [PERF] Add neighborhood cache to grids and improve iter_cell_list_contents #823
24+
* forest_fire: Remove unnecessary code #981
25+
* Migrate away from type comments #984
26+
* Update License #985
27+
* Public remove_agent function for NetworkGrid #1001
28+
* Date update to release #962
29+
* Advanced indexing of grid #820
30+
31+
**Fixes**
32+
33+
* Correct spelling #999
34+
* Update Pipfile.lock #983
35+
* Fix order of variable_params in model and agent vars data frames #979
36+
* Fix asyncio on windows with python 3.6 #973
1237

1338

1439
0.8.8 (2020-11-27) Nogales

examples/bank_reserves/bank_reserves/model.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727

2828
def get_num_rich_agents(model):
29-
""" return number of rich agents"""
29+
"""return number of rich agents"""
3030

3131
rich_agents = [a for a in model.schedule.agents if a.savings > model.rich_threshold]
3232
return len(rich_agents)

examples/boltzmann_wealth_model/boltzmann_wealth_model/model.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def run_model(self, n):
5050

5151

5252
class MoneyAgent(Agent):
53-
""" An agent with fixed initial wealth."""
53+
"""An agent with fixed initial wealth."""
5454

5555
def __init__(self, unique_id, model):
5656
super().__init__(unique_id, model)

examples/boltzmann_wealth_model_network/boltzmann_wealth_model_network/model.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def run_model(self, n):
5252

5353

5454
class MoneyAgent(Agent):
55-
""" An agent with fixed initial wealth."""
55+
"""An agent with fixed initial wealth."""
5656

5757
def __init__(self, unique_id, model):
5858
super().__init__(unique_id, model)

examples/charts/charts/model.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727

2828
def get_num_rich_agents(model):
29-
""" return number of rich agents"""
29+
"""return number of rich agents"""
3030

3131
rich_agents = [a for a in model.schedule.agents if a.savings > model.rich_threshold]
3232
return len(rich_agents)

examples/pd_grid/pd_grid/agent.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33

44
class PDAgent(Agent):
5-
""" Agent member of the iterated, spatial prisoner's dilemma model. """
5+
"""Agent member of the iterated, spatial prisoner's dilemma model."""
66

77
def __init__(self, pos, model, starting_move=None):
88
"""
@@ -28,7 +28,7 @@ def isCooroperating(self):
2828
return self.move == "C"
2929

3030
def step(self):
31-
""" Get the neighbors' moves, and change own move accordingly. """
31+
"""Get the neighbors' moves, and change own move accordingly."""
3232
neighbors = self.model.grid.get_neighbors(self.pos, True, include_center=True)
3333
best_neighbor = max(neighbors, key=lambda a: a.score)
3434
self.next_move = best_neighbor.move

examples/pd_grid/pd_grid/model.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88

99
class PdGrid(Model):
10-
""" Model class for iterated, spatial prisoner's dilemma model. """
10+
"""Model class for iterated, spatial prisoner's dilemma model."""
1111

1212
schedule_types = {
1313
"Sequential": BaseScheduler,
@@ -60,6 +60,6 @@ def step(self):
6060
self.datacollector.collect(self)
6161

6262
def run(self, n):
63-
""" Run the model for n steps. """
63+
"""Run the model for n steps."""
6464
for _ in range(n):
6565
self.step()

examples/schelling/model.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class Schelling(Model):
4141
"""
4242

4343
def __init__(self, height=20, width=20, density=0.8, minority_pc=0.2, homophily=3):
44-
""""""
44+
""" """
4545

4646
self.height = height
4747
self.width = width

mesa/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@
1414
__all__ = ["Model", "Agent"]
1515

1616
__title__ = "mesa"
17-
__version__ = "0.8.8.1"
17+
__version__ = "0.8.9"
1818
__license__ = "Apache 2.0"
1919
__copyright__ = "Copyright %s Project Mesa Team" % datetime.date.today().year

mesa/agent.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@
1010

1111

1212
class Agent:
13-
""" Base class for a model agent. """
13+
"""Base class for a model agent."""
1414

1515
def __init__(self, unique_id: int, model: Model) -> None:
16-
""" Create a new agent. """
16+
"""Create a new agent."""
1717
self.unique_id = unique_id
1818
self.model = model
1919
self.pos = None
2020

2121
def step(self) -> None:
22-
""" A single step of the agent. """
22+
"""A single step of the agent."""
2323
pass
2424

2525
def advance(self) -> None:

mesa/batchrunner.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def _make_model_args(self):
150150
return total_iterations, all_kwargs, all_param_values
151151

152152
def run_all(self):
153-
""" Run the model at all parameter combinations and store results. """
153+
"""Run the model at all parameter combinations and store results."""
154154
run_count = count()
155155
total_iterations, all_kwargs, all_param_values = self._make_model_args()
156156

@@ -210,15 +210,15 @@ def run_model(self, model):
210210
return None
211211

212212
def collect_model_vars(self, model):
213-
""" Run reporters and collect model-level variables. """
213+
"""Run reporters and collect model-level variables."""
214214
model_vars = OrderedDict()
215215
for var, reporter in self.model_reporters.items():
216216
model_vars[var] = reporter(model)
217217

218218
return model_vars
219219

220220
def collect_agent_vars(self, model):
221-
""" Run reporters and collect agent-level variables. """
221+
"""Run reporters and collect agent-level variables."""
222222
agent_vars = OrderedDict()
223223
for agent in model.schedule._agents.values():
224224
agent_record = OrderedDict()
@@ -412,7 +412,7 @@ def __init__(
412412

413413

414414
class BatchRunnerMP(BatchRunner):
415-
""" Child class of BatchRunner, extended with multiprocessing support. """
415+
"""Child class of BatchRunner, extended with multiprocessing support."""
416416

417417
def __init__(self, model_cls, nr_processes=None, **kwargs):
418418
"""Create a new BatchRunnerMP for a given model with the given

mesa/datacollection.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ def _new_table(self, table_name, table_columns):
154154
self.tables[table_name] = new_table
155155

156156
def _record_agents(self, model):
157-
""" Record agents data in a mapping of functions and agents. """
157+
"""Record agents data in a mapping of functions and agents."""
158158
rep_funcs = self.agent_reporters.values()
159159
if all([hasattr(rep, "attribute_name") for rep in rep_funcs]):
160160
prefix = ["model.schedule.steps", "unique_id"]
@@ -174,7 +174,7 @@ def _reporter_decorator(self, reporter):
174174
return reporter()
175175

176176
def collect(self, model):
177-
""" Collect all the data for the given model object. """
177+
"""Collect all the data for the given model object."""
178178
if self.model_reporters:
179179

180180
for var, reporter in self.model_reporters.items():
@@ -217,7 +217,7 @@ def add_table_row(self, table_name, row, ignore_missing=False):
217217

218218
@staticmethod
219219
def _getattr(name, _object):
220-
""" Turn around arguments of getattr to make it partially callable."""
220+
"""Turn around arguments of getattr to make it partially callable."""
221221
return getattr(_object, name, None)
222222

223223
def get_model_vars_dataframe(self):

mesa/model.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212

1313
class Model:
14-
""" Base class for models. """
14+
"""Base class for models."""
1515

1616
def __new__(cls, *args: Any, **kwargs: Any) -> Any:
1717
"""Create a new model object and instantiate its RNG automatically."""
@@ -42,11 +42,11 @@ def run_model(self) -> None:
4242
self.step()
4343

4444
def step(self) -> None:
45-
""" A single step. Fill in here. """
45+
"""A single step. Fill in here."""
4646
pass
4747

4848
def next_id(self) -> int:
49-
""" Return the next unique ID for agents, increment current_id"""
49+
"""Return the next unique ID for agents, increment current_id"""
5050
self.current_id += 1
5151
return self.current_id
5252

0 commit comments

Comments
 (0)