From 1573e25a8e1a515ef4dbf88540dc796d788642d6 Mon Sep 17 00:00:00 2001 From: rht Date: Wed, 24 Jan 2024 00:08:28 -0500 Subject: [PATCH] Should work now --- mesa/space.pyx | 6 +++--- pyproject.toml | 7 +++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/mesa/space.pyx b/mesa/space.pyx index 2d8bb75c515..84b976acfa6 100644 --- a/mesa/space.pyx +++ b/mesa/space.pyx @@ -67,7 +67,7 @@ def is_integer(x: Real) -> bool: return isinstance(x, _types_integer) -class _Grid: +cdef class _Grid: """Base class for a rectangular grid. Grid cells are indexed by [x, y], where [0, 0] is assumed to be the @@ -390,8 +390,8 @@ class _Grid: if cell != default_val: yield cell - @accept_tuple_argument - def get_cell_list_contents(self, cell_list: Iterable[Coordinate]) -> list[Agent]: + # @accept_tuple_argument + cpdef list get_cell_list_contents(self, cell_list: Iterable[Coordinate]): """Returns an iterator of the agents contained in the cells identified in `cell_list`; cells with empty content are excluded. diff --git a/pyproject.toml b/pyproject.toml index 80d3831d6a4..f739e5ecb93 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -76,6 +76,13 @@ packages = ["mesa"] [tool.hatch.version] path = "mesa/__init__.py" +[tool.hatch.build.hooks.cython] +dependencies = ["hatch-cython"] + +[tool.hatch.build.hooks.cython.options] +src = "mesa" +compile_py = false + [tool.ruff] # See https://github.com/charliermarsh/ruff#rules for error code definitions. select = [