diff --git a/gis/agents_and_networks/src/space/campus.py b/gis/agents_and_networks/src/space/campus.py index 00096080e..4ce5ef172 100644 --- a/gis/agents_and_networks/src/space/campus.py +++ b/gis/agents_and_networks/src/space/campus.py @@ -1,6 +1,5 @@ import random from collections import defaultdict -from typing import DefaultDict import mesa_geo as mg from shapely.geometry import Point @@ -15,9 +14,9 @@ class Campus(mg.GeoSpace): homes: tuple[Building] works: tuple[Building] other_buildings: tuple[Building] - home_counter: DefaultDict[FloatCoordinate, int] + home_counter: defaultdict[FloatCoordinate, int] _buildings: dict[int, Building] - _commuters_pos_map: DefaultDict[FloatCoordinate, set[Commuter]] + _commuters_pos_map: defaultdict[FloatCoordinate, set[Commuter]] _commuter_id_map: dict[int, Commuter] def __init__(self, crs: str) -> None: diff --git a/pyproject.toml b/pyproject.toml index d1514f823..ff897081d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,11 +5,14 @@ build-backend = "hatchling.build" [tool.hatch.build.targets.wheel] packages = ["examples", "gis", "rl"] +[tool.hatch.metadata] +allow-direct-references = true + [project] name = "mesa-models" description = "Importable Mesa models." license = {file = "LICENSE"} -requires-python = ">=3.8" +requires-python = ">=3.12" authors = [ {name = "Project Mesa Team", email = "maintainers@projectmesa.dev"} ] @@ -20,21 +23,28 @@ readme = "README.md" test = [ "pytest", "scipy", + "mesa[rec] @ git+https://github.com/mesa/mesa@main", ] test_gis = [ "pytest", "momepy", "pytest-cov", + "mesa[rec] @ git+https://github.com/mesa/mesa@main", ] rl_example = [ "stable-baselines3", "seaborn", - "mesa", + "mesa @ git+https://github.com/mesa/mesa@main", "tensorboard" ] +[tool.codespell] +ignore-words-list = ["ist", "hart", "nD"] + [tool.ruff] +target-version = "py312" extend-include = ["*.ipynb"] +extend-exclude = ["build"] [tool.ruff.lint] # See https://github.com/charliermarsh/ruff#rules for error code definitions. @@ -79,7 +89,6 @@ extend-ignore = [ "B905", # `zip()` without an explicit `strict=` parameter "N802", # Function name should be lowercase "N999", # Invalid module name. We should revisit this in the future, TODO - "RUF012", # Mutable class attributes should be annotated with `typing.ClassVar` TODO "S310", # Audit URL open for permitted schemes. Allowing use of `file:` or custom schemes is often unexpected. "S603", # `subprocess` call: check for execution of untrusted input "ISC001", # ruff format asks to disable this feature