Skip to content

Commit b0a36ec

Browse files
pre-commit-ci[bot]EwoutH
andauthoredDec 3, 2024··
[pre-commit.ci] pre-commit autoupdate (#2525)
* [pre-commit.ci] pre-commit autoupdate updates: - [github.com/astral-sh/ruff-pre-commit: v0.7.2 → v0.8.1](astral-sh/ruff-pre-commit@v0.7.2...v0.8.1) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix pre-commit: Format as f-strings New requirement by ruff 0.8.x --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Ewout ter Hoeven <[email protected]>
1 parent 867d2a9 commit b0a36ec

File tree

13 files changed

+29
-29
lines changed

13 files changed

+29
-29
lines changed
 

‎.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ ci:
44
repos:
55
- repo: https://github.com/astral-sh/ruff-pre-commit
66
# Ruff version.
7-
rev: v0.7.2
7+
rev: v0.8.1
88
hooks:
99
# Run the linter.
1010
- id: ruff

‎mesa/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
from mesa.model import Model
1414

1515
__all__ = [
16-
"Model",
1716
"Agent",
18-
"space",
1917
"DataCollector",
18+
"Model",
2019
"batch_run",
2120
"experimental",
21+
"space",
2222
]
2323

2424
__title__ = "mesa"

‎mesa/examples/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
"BoidFlockers",
1313
"BoltzmannWealth",
1414
"ConwaysGameOfLife",
15-
"Schelling",
16-
"VirusOnNetwork",
1715
"EpsteinCivilViolence",
1816
"PdGrid",
17+
"Schelling",
1918
"SugarscapeG1mt",
19+
"VirusOnNetwork",
2020
"WolfSheep",
2121
]

‎mesa/examples/basic/boltzmann_wealth_model/st_app.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
for i in range(num_ticks):
6969
model.step()
7070
my_bar.progress((i / num_ticks), text="Simulation progress")
71-
placeholder.text("Step = %d" % i)
71+
placeholder.text(f"Step = {i}")
7272
for cell in model.grid.coord_iter():
7373
cell_content, (x, y) = cell
7474
agent_count = len(cell_content)

‎mesa/examples/basic/conways_game_of_life/st_app.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@
4949
for i in range(num_ticks):
5050
model.step()
5151
my_bar.progress((i / num_ticks), text="Simulation progress")
52-
placeholder.text("Step = %d" % i)
52+
placeholder.text(f"Step = {i}")
5353
for contents, (x, y) in model.grid.coord_iter():
54-
# print('x:',x,'y:',y, 'state:',contents)
54+
# print(f"x: {x}, y: {y}, state: {contents}")
5555
selected_row = df_grid[(df_grid["x"] == x) & (df_grid["y"] == y)]
5656
df_grid.loc[selected_row.index, "state"] = (
5757
contents.state

‎mesa/experimental/cell_space/__init__.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,16 @@
2323
from mesa.experimental.cell_space.voronoi import VoronoiGrid
2424

2525
__all__ = [
26-
"CellCollection",
2726
"Cell",
2827
"CellAgent",
29-
"Grid2DMovingAgent",
30-
"FixedAgent",
28+
"CellCollection",
3129
"DiscreteSpace",
30+
"FixedAgent",
3231
"Grid",
32+
"Grid2DMovingAgent",
3333
"HexGrid",
34+
"Network",
3435
"OrthogonalMooreGrid",
3536
"OrthogonalVonNeumannGrid",
36-
"Network",
3737
"VoronoiGrid",
3838
]

‎mesa/experimental/cell_space/cell.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ class Cell:
3030
"""
3131

3232
__slots__ = [
33-
"coordinate",
34-
"connections",
33+
"__dict__",
34+
"_mesa_property_layers",
3535
"agents",
3636
"capacity",
37+
"connections",
38+
"coordinate",
3739
"properties",
3840
"random",
39-
"_mesa_property_layers",
40-
"__dict__",
4141
]
4242

4343
# def __new__(cls,

‎mesa/experimental/devs/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
from .eventlist import Priority, SimulationEvent
44
from .simulator import ABMSimulator, DEVSimulator
55

6-
__all__ = ["ABMSimulator", "DEVSimulator", "SimulationEvent", "Priority"]
6+
__all__ = ["ABMSimulator", "DEVSimulator", "Priority", "SimulationEvent"]

‎mesa/experimental/mesa_signals/__init__.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
from .observable_collections import ObservableList
55

66
__all__ = [
7-
"Observable",
8-
"ObservableList",
9-
"HasObservables",
107
"All",
118
"Computable",
129
"Computed",
10+
"HasObservables",
11+
"Observable",
12+
"ObservableList",
1313
]

‎mesa/experimental/mesa_signals/mesa_signal.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
from mesa.experimental.mesa_signals.signals_util import AttributeDict, create_weakref
1414

15-
__all__ = ["Observable", "HasObservables", "All", "Computable"]
15+
__all__ = ["All", "Computable", "HasObservables", "Observable"]
1616

1717
_hashable_signal = namedtuple("_HashableSignal", "instance name")
1818

‎mesa/experimental/mesa_signals/observable_collections.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def __set__(self, instance: "HasObservables", value: Iterable):
4343
class SignalingList(MutableSequence[Any]):
4444
"""A basic lists that emits signals on changes."""
4545

46-
__slots__ = ["owner", "name", "data"]
46+
__slots__ = ["data", "name", "owner"]
4747

4848
def __init__(self, iterable: Iterable, owner: HasObservables, name: str):
4949
"""Initialize a SignalingList.

‎mesa/mesa_logging.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@
1111
from logging import DEBUG, INFO
1212

1313
__all__ = [
14-
"get_rootlogger",
15-
"get_module_logger",
16-
"log_to_stderr",
1714
"DEBUG",
18-
"INFO",
1915
"DEFAULT_LEVEL",
16+
"INFO",
2017
"LOGGER_NAME",
21-
"method_logger",
2218
"function_logger",
19+
"get_module_logger",
20+
"get_rootlogger",
21+
"log_to_stderr",
22+
"method_logger",
2323
]
2424
LOGGER_NAME = "MESA"
2525
DEFAULT_LEVEL = DEBUG

‎mesa/visualization/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717

1818
__all__ = [
1919
"JupyterViz",
20-
"SolaraViz",
2120
"Slider",
22-
"make_space_altair",
21+
"SolaraViz",
2322
"draw_space",
2423
"make_plot_component",
24+
"make_space_altair",
2525
"make_space_component",
2626
]

0 commit comments

Comments
 (0)
Please sign in to comment.