Skip to content

Commit 32914bc

Browse files
committed
Merge branch 'feature/concrete-datacollector' of https://github.com/Ben-geo/mesa-frames into feature/concrete-datacollector
2 parents fb83a48 + 43cf55f commit 32914bc

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

mesa_frames/concrete/datacollector.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,9 @@ def _validate_reporter_table_columns(
430430
for col_name, required_column in reporter.items():
431431
if isinstance(required_column, str):
432432
for k, v in self._model.agents[required_column].items():
433-
expected_columns.add((col_name + "_" + str(k.__class__.__name__)).lower())
433+
expected_columns.add(
434+
(col_name + "_" + str(k.__class__.__name__)).lower()
435+
)
434436
else:
435437
expected_columns.add(col_name.lower())
436438

tests/test_datacollector.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ def test_postgress(self, fix1_model, postgres_uri):
433433
)
434434
""")
435435
conn.commit()
436-
436+
437437
model.dc = DataCollector(
438438
model=model,
439439
trigger=custom_trigger,
@@ -461,14 +461,16 @@ def test_postgress(self, fix1_model, postgres_uri):
461461
model_rows = cur.fetchall()
462462
assert model_rows == [(2, 12), (4, 12)]
463463

464-
cur.execute("SELECT step, wealth,age_ExampleAgentSet1, age_ExampleAgentSet2, age_ExampleAgentSet3 FROM agent_data WHERE step=2 ORDER BY wealth")
464+
cur.execute(
465+
"SELECT step, wealth,age_ExampleAgentSet1, age_ExampleAgentSet2, age_ExampleAgentSet3 FROM agent_data WHERE step=2 ORDER BY wealth"
466+
)
465467
agent_rows = cur.fetchall()
466468
assert agent_rows == [
467-
(2, 3, 10, 11, 3),
469+
(2, 3, 10, 11, 3),
468470
(2, 4, 20, 22, 4),
469471
(2, 5, 30, 33, 5),
470472
(2, 6, 40, 44, 6),
471-
]
473+
]
472474

473475
cur.close()
474476
conn.close()

0 commit comments

Comments
 (0)