Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions gis/agents_and_networks/src/space/campus.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import random
from collections import defaultdict
from typing import DefaultDict

import mesa_geo as mg
from shapely.geometry import Point
Expand All @@ -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:
Expand Down
15 changes: 12 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
]
Expand All @@ -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.
Expand Down Expand Up @@ -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
Expand Down