diff --git a/pyproject.toml b/pyproject.toml index 950f49e7..e983869f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "cityseer" -version = '4.6.8' +version = '4.7.0' description = "Computational tools for network-based pedestrian-scale urban analysis" readme = "README.md" requires-python = ">=3.10, <3.12" diff --git a/pysrc/cityseer/metrics/networks.py b/pysrc/cityseer/metrics/networks.py index bce40074..12610f94 100644 --- a/pysrc/cityseer/metrics/networks.py +++ b/pysrc/cityseer/metrics/networks.py @@ -178,7 +178,7 @@ def node_centrality_shortest( nodes_gdf[data_key] = getattr(result, measure_name)[distance] for distance in distances: # type: ignore data_key = config.prep_gdf_key(f"node_hillier_{distance}") - nodes_gdf[data_key] = result.node_density[distance] / result.node_farness[distance] # type: ignore + nodes_gdf[data_key] = result.node_density[distance] ** 2 / result.node_farness[distance] # type: ignore if compute_betweenness is True: for measure_name in ["node_betweenness", "node_betweenness_beta"]: for distance in distances: # type: ignore @@ -287,7 +287,7 @@ def node_centrality_simplest( nodes_gdf[data_key] = result.node_harmonic[distance] # type: ignore for distance in distances: # type: ignore data_key = config.prep_gdf_key(f"node_hillier_simplest_{distance}") - nodes_gdf[data_key] = result.node_density[distance] / result.node_farness[distance] # type: ignore + nodes_gdf[data_key] = result.node_density[distance] ** 2 / result.node_farness[distance] # type: ignore for distance in distances: # type: ignore data_key = config.prep_gdf_key(f"node_farness_simplest_{distance}") nodes_gdf[data_key] = result.node_farness[distance] # type: ignore diff --git a/tests/metrics/test_networks.py b/tests/metrics/test_networks.py index e0b01133..e45bbbb0 100644 --- a/tests/metrics/test_networks.py +++ b/tests/metrics/test_networks.py @@ -45,7 +45,7 @@ def test_node_centrality_shortest(primal_graph): ) assert np.allclose( nodes_gdf[config.prep_gdf_key(f"node_hillier_{distance}")], - node_result_short.node_density[distance] / node_result_short.node_farness[distance], + node_result_short.node_density[distance] ** 2 / node_result_short.node_farness[distance], equal_nan=True, atol=config.ATOL, rtol=config.RTOL, @@ -103,7 +103,7 @@ def test_node_centrality_simplest(primal_graph): ) assert np.allclose( nodes_gdf[config.prep_gdf_key(f"node_hillier_simplest_{distance}")], - node_result_simplest.node_density[distance] / node_result_simplest.node_farness[distance], + node_result_simplest.node_density[distance] ** 2 / node_result_simplest.node_farness[distance], equal_nan=True, atol=config.ATOL, rtol=config.RTOL,