Skip to content

Commit

Permalink
remove deprecated HexGrid class (#2441)
Browse files Browse the repository at this point in the history
* remove deprecated HexGrid class

closes #1847

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
quaquel and pre-commit-ci[bot] authored Oct 30, 2024
1 parent 92054d7 commit 0e5abd9
Showing 1 changed file with 0 additions and 30 deletions.
30 changes: 0 additions & 30 deletions mesa/space.py
Original file line number Diff line number Diff line change
Expand Up @@ -1287,36 +1287,6 @@ class HexMultiGrid(_HexGrid, MultiGrid):
"""


class HexGrid(HexSingleGrid):
"""Hexagonal Grid: a Grid where neighbors are computed according to a hexagonal tiling of the grid.
Functions according to odd-q rules.
See http://www.redblobgames.com/grids/hexagons/#coordinates for more.
Properties:
width, height: The grid's width and height.
torus: Boolean which determines whether to treat the grid as a torus.
"""

def __init__(self, width: int, height: int, torus: bool) -> None:
"""Initializes a HexGrid, deprecated.
Args:
width: the width of the grid
height: the height of the grid
torus: whether the grid wraps
"""
super().__init__(width, height, torus)
warn(
(
"HexGrid is being deprecated; use instead HexSingleGrid or HexMultiGrid "
"depending on your use case."
),
DeprecationWarning,
stacklevel=2,
)


class ContinuousSpace:
"""Continuous space where each agent can have an arbitrary position.
Expand Down

0 comments on commit 0e5abd9

Please sign in to comment.