Skip to content

Commit

Permalink
use ordered dict to make compatible with python 3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
tpike3 committed Aug 23, 2020
1 parent f530b41 commit 48f7e12
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 4 additions & 2 deletions mesa/batchrunner.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from multiprocessing import Pool, cpu_count
import pandas as pd
from tqdm import tqdm
from collections import OrderedDict


class ParameterError(TypeError):
Expand Down Expand Up @@ -109,8 +110,9 @@ def __init__(
if self.agent_reporters:
self.agent_vars = {}

self.datacollector_model_reporters = {}
self.datacollector_agent_reporters = {}
#Make Compatible with Python 3.5
self.datacollector_model_reporters = OrderedDict()
self.datacollector_agent_reporters = OrderedDict()

self.display_progress = display_progress

Expand Down
1 change: 0 additions & 1 deletion tests/test_batchrunner.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ def test_agent_level_vars(self):
agent_collector = batch.get_collector_agents()
# extra columns with run index and agentId
expected_cols = (len(self.variable_params) + len(self.agent_reporters) + 2)

self.assertEqual(agent_vars.shape, (self.model_runs * NUM_AGENTS, expected_cols))

self.assertEqual(
Expand Down

0 comments on commit 48f7e12

Please sign in to comment.