Skip to content

Commit 55ce2de

Browse files
committed
move cell_space out of experimental to spaces folder
move, rename, import changes
1 parent 88fbf74 commit 55ce2de

File tree

14 files changed

+41
-45
lines changed

14 files changed

+41
-45
lines changed

mesa/__init__.py

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

77
import datetime
88

9-
import mesa.space as space
9+
import mesa.space as old_space
10+
# import mesa.spaces as spaces
1011
import mesa.time as time
1112
from mesa.agent import Agent
1213
from mesa.batchrunner import batch_run
@@ -17,7 +18,8 @@
1718
"Model",
1819
"Agent",
1920
"time",
20-
"space",
21+
"old_space",
22+
"spaces",
2123
"DataCollector",
2224
"batch_run",
2325
"experimental",

mesa/experimental/__init__.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from mesa.experimental import cell_space
2-
31
from .solara_viz import JupyterViz, Slider, SolaraViz, make_text
42

5-
__all__ = ["cell_space", "JupyterViz", "SolaraViz", "make_text", "Slider"]
3+
__all__ = ["JupyterViz", "SolaraViz", "make_text", "Slider"]

mesa/experimental/cell_space/__init__.py

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

mesa/experimental/components/matplotlib.py

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

88
import mesa
9-
from mesa.experimental.cell_space import VoronoiGrid
9+
1010

1111

1212
@solara.component
@@ -154,6 +154,7 @@ def portray(space):
154154

155155

156156
def _draw_voronoi(space, space_ax, agent_portrayal):
157+
from mesa.spaces.voronoi import VoronoiGrid
157158
def portray(g):
158159
x = []
159160
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
@@ -4,10 +4,10 @@
44
from random import Random
55
from typing import TYPE_CHECKING
66

7-
from mesa.experimental.cell_space.cell_collection import CellCollection
7+
from mesa.spaces.cell_collection import CellCollection
88

99
if TYPE_CHECKING:
10-
from mesa.experimental.cell_space.cell_agent import CellAgent
10+
from mesa.spaces.cell_agent import CellAgent
1111

1212

1313
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
@@ -5,7 +5,7 @@
55
from mesa import Agent, Model
66

77
if TYPE_CHECKING:
8-
from mesa.experimental.cell_space.cell import Cell
8+
from mesa.spaces.cell import Cell
99

1010

1111
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
@@ -7,8 +7,8 @@
77
from typing import TYPE_CHECKING, Generic, TypeVar
88

99
if TYPE_CHECKING:
10-
from mesa.experimental.cell_space.cell import Cell
11-
from mesa.experimental.cell_space.cell_agent import CellAgent
10+
from mesa.spaces.cell import Cell
11+
from mesa.spaces.cell_agent import CellAgent
1212

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

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
@@ -4,8 +4,8 @@
44
from random import Random
55
from typing import Generic, TypeVar
66

7-
from mesa.experimental.cell_space.cell import Cell
8-
from mesa.experimental.cell_space.cell_collection import CellCollection
7+
from mesa.spaces.cell import Cell
8+
from mesa.spaces.cell_collection import CellCollection
99

1010
T = TypeVar("T", bound=Cell)
1111

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
@@ -5,7 +5,7 @@
55
from random import Random
66
from typing import Generic, TypeVar
77

8-
from mesa.experimental.cell_space import Cell, DiscreteSpace
8+
from mesa.spaces import Cell, DiscreteSpace
99

1010
T = TypeVar("T", bound=Cell)
1111

0 commit comments

Comments
 (0)