Skip to content

Commit 9c71ed0

Browse files
songololoclaude
andcommitted
Fix type checker errors, bump QGIS plugin version
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 4604acb commit 9c71ed0

File tree

5 files changed

+16
-13
lines changed

5 files changed

+16
-13
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "cityseer"
3-
version = '4.25.0b13'
3+
version = '4.25.0b15'
44
description = "Computational tools for network-based pedestrian-scale urban analysis"
55
readme = "README.md"
66
requires-python = ">=3.10, <3.14" # pending fiona support for 3.14

pysrc/cityseer/metrics/networks.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151

5252
import logging
5353
from functools import partial
54+
from typing import cast
5455

5556
import geopandas as gpd
5657
import numpy as np
@@ -195,7 +196,7 @@ def _extract_results(
195196
for name in next(iter(results.values())).metrics:
196197
col_key = config.prep_gdf_key(name, d, angular=angular)
197198
if col_key in temp_data:
198-
namespace[name] = temp_data[col_key]
199+
namespace[name] = cast(np.ndarray, temp_data[col_key])
199200
try:
200201
with np.errstate(divide="ignore", invalid="ignore"):
201202
data_key = config.prep_gdf_key(pp_name, d, angular=angular)
@@ -527,8 +528,11 @@ def betweenness_od(
527528
speed_m_s=speed_m_s,
528529
tolerance=tolerance,
529530
)
530-
result = config.wrap_progress(
531-
total=network_structure.street_node_count(), rust_struct=network_structure, partial_func=partial_func
531+
result = cast(
532+
rustalgos.centrality.CentralityResult,
533+
config.wrap_progress(
534+
total=network_structure.street_node_count(), rust_struct=network_structure, partial_func=partial_func
535+
),
532536
)
533537
resolved_distances = config.log_thresholds(
534538
distances=distances,

pysrc/cityseer/rustalgos/centrality.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ class OdMatrix:
2727
"""Number of unique origin nodes."""
2828
...
2929

30-
3130
class CentralityResult:
3231
"""Holds centrality results from closeness, betweenness, and/or cycles computation."""
3332

qgis_plugin/cityseer_qgis/algorithms/centrality.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -445,13 +445,13 @@ def _store(result, col_prefix, metric_names, derive_hillier=False):
445445
and d in metrics["density"]
446446
and d in metrics["farness"]
447447
):
448-
density = metrics["density"][d]
449-
farness = metrics["farness"][d]
450-
for i, fid in enumerate(result.node_keys_py):
451-
if fid in results and farness[i] > 0:
452-
val = float(density[i] ** 2 / farness[i])
453-
hcol = f"cc_hillier_{d}_{col_prefix}" if col_prefix else f"cc_hillier_{d}"
454-
results[fid][hcol] = val if math.isfinite(val) else None
448+
density = metrics["density"][d]
449+
farness = metrics["farness"][d]
450+
for i, fid in enumerate(result.node_keys_py):
451+
if fid in results and farness[i] > 0:
452+
val = float(density[i] ** 2 / farness[i])
453+
hcol = f"cc_hillier_{d}_{col_prefix}" if col_prefix else f"cc_hillier_{d}"
454+
results[fid][hcol] = val if math.isfinite(val) else None
455455

456456
def _run_metric_batches(
457457
label,

qgis_plugin/cityseer_qgis/metadata.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name=Cityseer
33
qgisMinimumVersion=4.0
44
description=Urban network analysis: centrality, accessibility, and statistics
5-
version=4.25.0beta9
5+
version=4.25.0beta15
66
author=Benchmark Urbanism
77
email=gareth.simons@ucl.ac.uk
88

0 commit comments

Comments
 (0)