Skip to content

Commit 1573e25

Browse files
committed
Should work now
1 parent 324d56f commit 1573e25

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

mesa/space.pyx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def is_integer(x: Real) -> bool:
6767
return isinstance(x, _types_integer)
6868

6969

70-
class _Grid:
70+
cdef class _Grid:
7171
"""Base class for a rectangular grid.
7272

7373
Grid cells are indexed by [x, y], where [0, 0] is assumed to be the
@@ -390,8 +390,8 @@ class _Grid:
390390
if cell != default_val:
391391
yield cell
392392

393-
@accept_tuple_argument
394-
def get_cell_list_contents(self, cell_list: Iterable[Coordinate]) -> list[Agent]:
393+
# @accept_tuple_argument
394+
cpdef list get_cell_list_contents(self, cell_list: Iterable[Coordinate]):
395395
"""Returns an iterator of the agents contained in the cells identified
396396
in `cell_list`; cells with empty content are excluded.
397397

pyproject.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,13 @@ packages = ["mesa"]
7676
[tool.hatch.version]
7777
path = "mesa/__init__.py"
7878

79+
[tool.hatch.build.hooks.cython]
80+
dependencies = ["hatch-cython"]
81+
82+
[tool.hatch.build.hooks.cython.options]
83+
src = "mesa"
84+
compile_py = false
85+
7986
[tool.ruff]
8087
# See https://github.com/charliermarsh/ruff#rules for error code definitions.
8188
select = [

0 commit comments

Comments
 (0)