Skip to content

Commit e99811d

Browse files
committed
move cell_space out of experimental to spaces folder
move, rename, import changes
1 parent 3fa0c27 commit e99811d

File tree

14 files changed

+41
-53
lines changed

14 files changed

+41
-53
lines changed

mesa/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55

66
import datetime
77

8-
import mesa.space as space
8+
import mesa.space as old_space
9+
# import mesa.spaces as spaces
910
import mesa.time as time
1011
from mesa.agent import Agent
1112
from mesa.batchrunner import batch_run
@@ -16,7 +17,8 @@
1617
"Model",
1718
"Agent",
1819
"time",
19-
"space",
20+
"old_space",
21+
"spaces",
2022
"DataCollector",
2123
"batch_run",
2224
"experimental",

mesa/experimental/__init__.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
"""Experimental init."""
2-
3-
from mesa.experimental import cell_space
4-
52
from .solara_viz import JupyterViz, Slider, SolaraViz, make_text
63

7-
__all__ = ["cell_space", "JupyterViz", "SolaraViz", "make_text", "Slider"]
4+
__all__ = ["JupyterViz", "SolaraViz", "make_text", "Slider"]

mesa/experimental/cell_space/__init__.py

Lines changed: 0 additions & 32 deletions
This file was deleted.

mesa/experimental/components/matplotlib.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from matplotlib.ticker import MaxNLocator
99

1010
import mesa
11-
from mesa.experimental.cell_space import VoronoiGrid
11+
1212

1313

1414
@solara.component
@@ -164,6 +164,7 @@ def portray(space):
164164

165165

166166
def _draw_voronoi(space, space_ax, agent_portrayal):
167+
from mesa.spaces.voronoi import VoronoiGrid
167168
def portray(g):
168169
x = []
169170
y = []

mesa/spaces/__init__.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
from mesa.spaces.network import Network
2+
from mesa.spaces.cell import Cell
3+
from mesa.spaces.cell_agent import CellAgent
4+
from mesa.spaces.cell_collection import CellCollection
5+
from mesa.spaces.discrete_space import DiscreteSpace
6+
from mesa.spaces.grid import Grid, HexGrid, OrthogonalMooreGrid, OrthogonalVonNeumannGrid
7+
from mesa.spaces.voronoi import VoronoiGrid
8+
9+
__all__ = [
10+
"CellCollection",
11+
"Cell",
12+
"CellAgent",
13+
"DiscreteSpace",
14+
"Grid",
15+
"HexGrid",
16+
"OrthogonalMooreGrid",
17+
"OrthogonalVonNeumannGrid",
18+
"Network",
19+
"VoronoiGrid",
20+
]

mesa/experimental/cell_space/cell.py renamed to mesa/spaces/cell.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
from random import Random
77
from typing import TYPE_CHECKING
88

9-
from mesa.experimental.cell_space.cell_collection import CellCollection
9+
from mesa.spaces.cell_collection import CellCollection
1010

1111
if TYPE_CHECKING:
12-
from mesa.experimental.cell_space.cell_agent import CellAgent
12+
from mesa.spaces.cell_agent import CellAgent
1313

1414

1515
class Cell:

mesa/experimental/cell_space/cell_agent.py renamed to mesa/spaces/cell_agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from mesa import Agent, Model
88

99
if TYPE_CHECKING:
10-
from mesa.experimental.cell_space.cell import Cell
10+
from mesa.spaces.cell import Cell
1111

1212

1313
class CellAgent(Agent):

mesa/experimental/cell_space/cell_collection.py renamed to mesa/spaces/cell_collection.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
from typing import TYPE_CHECKING, Generic, TypeVar
1010

1111
if TYPE_CHECKING:
12-
from mesa.experimental.cell_space.cell import Cell
13-
from mesa.experimental.cell_space.cell_agent import CellAgent
12+
from mesa.spaces.cell import Cell
13+
from mesa.spaces.cell_agent import CellAgent
1414

1515
T = TypeVar("T", bound="Cell")
1616

mesa/experimental/cell_space/discrete_space.py renamed to mesa/spaces/discrete_space.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
from random import Random
77
from typing import Generic, TypeVar
88

9-
from mesa.experimental.cell_space.cell import Cell
10-
from mesa.experimental.cell_space.cell_collection import CellCollection
9+
from mesa.spaces.cell import Cell
10+
from mesa.spaces.cell_collection import CellCollection
1111

1212
T = TypeVar("T", bound=Cell)
1313

mesa/experimental/cell_space/grid.py renamed to mesa/spaces/grid.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from random import Random
88
from typing import Generic, TypeVar
99

10-
from mesa.experimental.cell_space import Cell, DiscreteSpace
10+
from mesa.spaces import Cell, DiscreteSpace
1111

1212
T = TypeVar("T", bound=Cell)
1313

0 commit comments

Comments
 (0)