Skip to content

Commit 43b7010

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent c9d51ad commit 43b7010

File tree

6 files changed

+19
-19
lines changed

6 files changed

+19
-19
lines changed

examples/hotelling_law/tests.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ def test_decreasing_price_variance():
3232

3333
df_model = model.datacollector.get_model_vars_dataframe()
3434

35-
assert check_slope(
36-
df_model["Price Variance"], increasing=False
37-
), "The price variance should decrease over time."
35+
assert check_slope(df_model["Price Variance"], increasing=False), (
36+
"The price variance should decrease over time."
37+
)
3838

3939

4040
def test_constant_price_variance():
@@ -53,6 +53,6 @@ def test_constant_price_variance():
5353

5454
df_model = model.datacollector.get_model_vars_dataframe()
5555

56-
assert (
57-
get_slope(df_model["Price Variance"]) == 0
58-
), "The price variance constant over time."
56+
assert get_slope(df_model["Price Variance"]) == 0, (
57+
"The price variance constant over time."
58+
)

gis/agents_and_networks/src/space/campus.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111

1212

1313
class Campus(mg.GeoSpace):
14-
homes: Tuple[Building]
15-
works: Tuple[Building]
16-
other_buildings: Tuple[Building]
14+
homes: tuple[Building]
15+
works: tuple[Building]
16+
other_buildings: tuple[Building]
1717
home_counter: DefaultDict[mesa.space.FloatCoordinate, int]
18-
_buildings: Dict[int, Building]
19-
_commuters_pos_map: DefaultDict[mesa.space.FloatCoordinate, Set[Commuter]]
20-
_commuter_id_map: Dict[int, Commuter]
18+
_buildings: dict[int, Building]
19+
_commuters_pos_map: DefaultDict[mesa.space.FloatCoordinate, set[Commuter]]
20+
_commuter_id_map: dict[int, Commuter]
2121

2222
def __init__(self, crs: str) -> None:
2323
super().__init__(crs=crs)
@@ -56,7 +56,7 @@ def add_buildings(self, agents) -> None:
5656

5757
def get_commuters_by_pos(
5858
self, float_pos: mesa.space.FloatCoordinate
59-
) -> Set[Commuter]:
59+
) -> set[Commuter]:
6060
return self._commuters_pos_map[float_pos]
6161

6262
def get_commuter_by_id(self, commuter_id: int) -> Commuter:
@@ -69,7 +69,7 @@ def add_commuter(self, agent: Commuter) -> None:
6969

7070
def update_home_counter(
7171
self,
72-
old_home_pos: Optional[mesa.space.FloatCoordinate],
72+
old_home_pos: mesa.space.FloatCoordinate | None,
7373
new_home_pos: mesa.space.FloatCoordinate,
7474
) -> None:
7575
if old_home_pos is not None:

gis/agents_and_networks/src/space/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def get_coord_matrix(
2323

2424
def get_affine_transform(
2525
from_coord: np.ndarray, to_coord: np.ndarray
26-
) -> Tuple[float, float, float, float, float, float]:
26+
) -> tuple[float, float, float, float, float, float]:
2727
A, res, rank, s = np.linalg.lstsq(from_coord, to_coord, rcond=None)
2828

2929
np.testing.assert_array_almost_equal(res, np.zeros_like(res), decimal=15)
@@ -44,7 +44,7 @@ def get_rounded_coordinate(
4444

4545

4646
def segmented(lines: gpd.GeoSeries) -> gpd.GeoSeries:
47-
def _segmented(linestring: LineString) -> List[LineString]:
47+
def _segmented(linestring: LineString) -> list[LineString]:
4848
return [
4949
LineString((start_node, end_node))
5050
for start_node, end_node in zip(

gis/geo_schelling_points/geo_schelling_points/space.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88

99
class Nuts2Eu(mg.GeoSpace):
10-
_id_region_map: Dict[str, RegionAgent]
10+
_id_region_map: dict[str, RegionAgent]
1111
num_people: int
1212

1313
def __init__(self):

gis/rainfall/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
}
1414

1515

16-
def cell_portrayal(cell: LakeCell) -> Tuple[float, float, float, float]:
16+
def cell_portrayal(cell: LakeCell) -> tuple[float, float, float, float]:
1717
if cell.water_level == 0:
1818
return cell.elevation, cell.elevation, cell.elevation, 1
1919
else:

gis/urban_growth/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from urban_growth.space import UrbanCell
88

99

10-
def cell_portrayal(cell: UrbanCell) -> Tuple[float, float, float, float]:
10+
def cell_portrayal(cell: UrbanCell) -> tuple[float, float, float, float]:
1111
if cell.urban:
1212
if cell.old_urbanized:
1313
return 0, 0, 255, 1

0 commit comments

Comments
 (0)