diff --git a/docs/src/pages/metrics/layers.md b/docs/src/pages/metrics/layers.md index 81760069..f1cebca9 100644 --- a/docs/src/pages/metrics/layers.md +++ b/docs/src/pages/metrics/layers.md @@ -1,15 +1,16 @@ --- layout: ../../layouts/PageLayout.astro --- -
# layers +
## assign_gdf_to_network +
assign_gdf_to_network
( @@ -40,10 +41,9 @@ layout: ../../layouts/PageLayout.astro
-Assign a `GeoDataFrame` to a [`rustalgos.NetworkStructure`](/rustalgos/rustalgos#networkstructure). A `NetworkStructure` provides the backbone for the calculation of land-use and statistical aggregations over the network. Data points will be assigned to the two closest network nodes — one in either direction — based on the closest adjacent street edge. This facilitates a dynamic spatial aggregation strategy which will select the shortest distance to a data point relative to either direction of approach. + Assign a `GeoDataFrame` to a [`rustalgos.NetworkStructure`](/rustalgos/rustalgos#networkstructure). A `NetworkStructure` provides the backbone for the calculation of land-use and statistical aggregations over the network. Data points will be assigned to the two closest network nodes — one in either direction — based on the closest adjacent street edge. This facilitates a dynamic spatial aggregation strategy which will select the shortest distance to a data point relative to either direction of approach. ### Parameters -
data_gdf
@@ -51,8 +51,7 @@ Assign a `GeoDataFrame` to a [`rustalgos.NetworkStructure`](/rustalgos/rustalgos
-A [`GeoDataFrame`](https://geopandas.org/en/stable/docs/user_guide/data_structures.html#geodataframe) representing data points. The coordinates of data points should correspond as precisely as possible to the location of the feature in space; or, in the case of buildings, should ideally correspond to the location of the building entrance.
- + A [`GeoDataFrame`](https://geopandas.org/en/stable/docs/user_guide/data_structures.html#geodataframe) representing data points. The coordinates of data points should correspond as precisely as possible to the location of the feature in space; or, in the case of buildings, should ideally correspond to the location of the building entrance.
@@ -62,8 +61,7 @@ A [`GeoDataFrame`](https://geopandas.org/en/stable/docs/user_guide/data_structur
-A [`rustalgos.NetworkStructure`](/rustalgos/rustalgos#networkstructure).
- + A [`rustalgos.NetworkStructure`](/rustalgos/rustalgos#networkstructure).
@@ -73,8 +71,7 @@ A [`rustalgos.NetworkStructure`](/rustalgos/rustalgos#networkstructure).
-The maximum distance to consider when assigning respective data points to the nearest adjacent network nodes.
- + The maximum distance to consider when assigning respective data points to the nearest adjacent network nodes.
@@ -84,12 +81,10 @@ The maximum distance to consider when assigning respective data points to the ne
-An optional column name for data point keys. This is used for deduplicating points representing a shared source of information. For example, where a single greenspace is represented by many entrances as datapoints, only the nearest entrance (from a respective location) will be considered (during aggregations) when the points share a datapoint identifier.
- + An optional column name for data point keys. This is used for deduplicating points representing a shared source of information. For example, where a single greenspace is represented by many entrances as datapoints, only the nearest entrance (from a respective location) will be considered (during aggregations) when the points share a datapoint identifier. ### Returns -
data_map
@@ -97,8 +92,7 @@ An optional column name for data point keys. This is used for deduplicating poin
-A [`rustalgos.DataMap`](/rustalgos#datamap) instance.
- + A [`rustalgos.DataMap`](/rustalgos#datamap) instance.
@@ -108,8 +102,7 @@ A [`rustalgos.DataMap`](/rustalgos#datamap) instance.
-The input `data_gdf` is returned with two additional columns: `nearest_assigned` and `next_neareset_assign`.
- + The input `data_gdf` is returned with two additional columns: `nearest_assigned` and `next_neareset_assign`. ### Notes @@ -137,10 +130,12 @@ representation of variations of metrics along street-fronts. +
## compute_accessibilities +
compute_accessibilities
( @@ -216,10 +211,9 @@ representation of variations of metrics along street-fronts.
-Compute land-use accessibilities for the specified land-use classification keys over the street network. The landuses are aggregated and computed over the street network relative to the network nodes, with the implication that the measures are generated from the same locations as those used for centrality computations. + Compute land-use accessibilities for the specified land-use classification keys over the street network. The landuses are aggregated and computed over the street network relative to the network nodes, with the implication that the measures are generated from the same locations as those used for centrality computations. ### Parameters -
data_gdf
@@ -227,8 +221,7 @@ Compute land-use accessibilities for the specified land-use classification keys
-A [`GeoDataFrame`](https://geopandas.org/en/stable/docs/user_guide/data_structures.html#geodataframe) representing data points. The coordinates of data points should correspond as precisely as possible to the location of the feature in space; or, in the case of buildings, should ideally correspond to the location of the building entrance.
- + A [`GeoDataFrame`](https://geopandas.org/en/stable/docs/user_guide/data_structures.html#geodataframe) representing data points. The coordinates of data points should correspond as precisely as possible to the location of the feature in space; or, in the case of buildings, should ideally correspond to the location of the building entrance.
@@ -238,8 +231,7 @@ A [`GeoDataFrame`](https://geopandas.org/en/stable/docs/user_guide/data_structur
-The column label from which to take landuse categories, e.g. a column labelled "landuse_categories" might contain "shop", "pub", "school", etc.
- + The column label from which to take landuse categories, e.g. a column labelled "landuse_categories" might contain "shop", "pub", "school", etc.
@@ -249,8 +241,7 @@ The column label from which to take landuse categories, e.g. a column labelled &
-Land-use keys for which to compute accessibilities. The keys should be selected from the same land-use schema used for the `landuse_labels` parameter, e.g. "pub". The calculations will be performed in both `weighted` and `non_weighted` variants.
- + Land-use keys for which to compute accessibilities. The keys should be selected from the same land-use schema used for the `landuse_labels` parameter, e.g. "pub". The calculations will be performed in both weighted `wt` and non_weighted `nw` variants.
@@ -260,8 +251,7 @@ Land-use keys for which to compute accessibilities. The keys should be selected
-A [`GeoDataFrame`](https://geopandas.org/en/stable/docs/user_guide/data_structures.html#geodataframe) representing nodes. Best generated with the [`io.network_structure_from_nx`](/tools/io#network-structure-from-nx) function. The outputs of calculations will be written to this `GeoDataFrame`, which is then returned from the function.
- + A [`GeoDataFrame`](https://geopandas.org/en/stable/docs/user_guide/data_structures.html#geodataframe) representing nodes. Best generated with the [`io.network_structure_from_nx`](/tools/io#network-structure-from-nx) function. The outputs of calculations will be written to this `GeoDataFrame`, which is then returned from the function.
@@ -271,8 +261,7 @@ A [`GeoDataFrame`](https://geopandas.org/en/stable/docs/user_guide/data_structur
-A [`rustalgos.NetworkStructure`](/rustalgos/rustalgos#networkstructure). Best generated with the [`io.network_structure_from_nx`](/tools/io#network-structure-from-nx) function.
- + A [`rustalgos.NetworkStructure`](/rustalgos/rustalgos#networkstructure). Best generated with the [`io.network_structure_from_nx`](/tools/io#network-structure-from-nx) function.
@@ -282,8 +271,7 @@ A [`rustalgos.NetworkStructure`](/rustalgos/rustalgos#networkstructure). Best ge
-The maximum distance to consider when assigning respective data points to the nearest adjacent network nodes.
- + The maximum distance to consider when assigning respective data points to the nearest adjacent network nodes.
@@ -293,8 +281,7 @@ The maximum distance to consider when assigning respective data points to the ne
-Distances corresponding to the local $d_{max}$ thresholds to be used for calculations. The $\beta$ parameters (for distance-weighted metrics) will be determined implicitly. If the `distances` parameter is not provided, then the `beta` parameter must be provided instead.
- + Distances corresponding to the local $d_{max}$ thresholds to be used for calculations. The $\beta$ parameters (for distance-weighted metrics) will be determined implicitly. If the `distances` parameter is not provided, then the `beta` parameter must be provided instead.
@@ -304,8 +291,7 @@ Distances corresponding to the local $d_{max}$ thresholds to be used for calcula
-A $\beta$, or array of $\beta$ to be used for the exponential decay function for weighted metrics. The `distance` parameters for unweighted metrics will be determined implicitly. If the `betas` parameter is not provided, then the `distance` parameter must be provided instead.
- + A $\beta$, or array of $\beta$ to be used for the exponential decay function for weighted metrics. The `distance` parameters for unweighted metrics will be determined implicitly. If the `betas` parameter is not provided, then the `distance` parameter must be provided instead.
@@ -315,8 +301,7 @@ A $\beta$, or array of $\beta$ to be used for the exponential decay function for
-An optional column name for data point keys. This is used for deduplicating points representing a shared source of information. For example, where a single greenspace is represented by many entrances as datapoints, only the nearest entrance (from a respective location) will be considered (during aggregations) when the points share a datapoint identifier.
- + An optional column name for data point keys. This is used for deduplicating points representing a shared source of information. For example, where a single greenspace is represented by many entrances as datapoints, only the nearest entrance (from a respective location) will be considered (during aggregations) when the points share a datapoint identifier.
@@ -326,8 +311,7 @@ An optional column name for data point keys. This is used for deduplicating poin
-Whether to use a simplest-path heuristic in-lieu of a shortest-path heuristic when calculating aggregations and distances.
- + Whether to use a simplest-path heuristic in-lieu of a shortest-path heuristic when calculating aggregations and distances.
@@ -337,8 +321,7 @@ Whether to use a simplest-path heuristic in-lieu of a shortest-path heuristic wh
-Tolerance in metres indicating a spatial buffer for datapoint accuracy. Intended for situations where datapoint locations are not precise. If greater than zero, weighted functions will clip the spatial impedance curve above weights corresponding to the given spatial tolerance and normalises to the new range. For background, see [`rustalgos.clip_weights_curve`](/rustalgos#clip-weights-curve).
- + Tolerance in metres indicating a spatial buffer for datapoint accuracy. Intended for situations where datapoint locations are not precise. If greater than zero, weighted functions will clip the spatial impedance curve above weights corresponding to the given spatial tolerance and normalises to the new range. For background, see [`rustalgos.clip_weights_curve`](/rustalgos#clip-weights-curve).
@@ -348,8 +331,7 @@ Tolerance in metres indicating a spatial buffer for datapoint accuracy. Intended
-The default `min_threshold_wt` parameter can be overridden to generate custom mappings between the `distance` and `beta` parameters. See [`rustalgos.distances_from_beta`](/rustalgos#distances-from-betas) for more information.
- + The default `min_threshold_wt` parameter can be overridden to generate custom mappings between the `distance` and `beta` parameters. See [`rustalgos.distances_from_beta`](/rustalgos#distances-from-betas) for more information.
@@ -359,12 +341,10 @@ The default `min_threshold_wt` parameter can be overridden to generate custom ma
-The scale of random jitter to add to shortest path calculations, useful for situations with highly rectilinear grids or for smoothing metrics on messy network representations. A random sample is drawn from a range of zero to one and is then multiplied by the specified `jitter_scale`. This random value is added to the shortest path calculations to provide random variation to the paths traced through the network. When working with shortest paths in metres, the random value represents distance in metres. When using a simplest path heuristic, the jitter will represent angular change in degrees.
- + The scale of random jitter to add to shortest path calculations, useful for situations with highly rectilinear grids or for smoothing metrics on messy network representations. A random sample is drawn from a range of zero to one and is then multiplied by the specified `jitter_scale`. This random value is added to the shortest path calculations to provide random variation to the paths traced through the network. When working with shortest paths in metres, the random value represents distance in metres. When using a simplest path heuristic, the jitter will represent angular change in degrees. ### Returns -
nodes_gdf
@@ -372,8 +352,7 @@ The scale of random jitter to add to shortest path calculations, useful for situ
-The input `node_gdf` parameter is returned with additional columns populated with the calcualted metrics. Three columns will be returned for each input landuse class and distance combination; a simple count of reachable locations, a distance weighted count of reachable locations, and the smallest distance to the nearest location.
- + The input `node_gdf` parameter is returned with additional columns populated with the calcualted metrics. Three columns will be returned for each input landuse class and distance combination; a simple count of reachable locations, a distance weighted count of reachable locations, and the smallest distance to the nearest location.
@@ -383,15 +362,14 @@ The input `node_gdf` parameter is returned with additional columns populated wit
-The input `data_gdf` is returned with two additional columns: `nearest_assigned` and `next_neareset_assign`.
- + The input `data_gdf` is returned with two additional columns: `nearest_assigned` and `next_neareset_assign`. ### Notes ```python from cityseer.metrics import networks, layers -from cityseer.tools import mock, graphs +from cityseer.tools import mock, graphs, io # prepare a mock graph G = mock.mock_graph() @@ -410,19 +388,22 @@ nodes_gdf, landuses_gdf = layers.compute_accessibilities( ) print(nodes_gdf.columns) # weighted form -print(nodes_gdf["cc_400_wt"]) +print(nodes_gdf["cc_c_400_wt"]) # non-weighted form -print(nodes_gdf["cc_400_nw"]) +print(nodes_gdf["cc_c_400_nw"]) # nearest distance to landuse -print(nodes_gdf["cc_distance"]) +print(nodes_gdf["cc_c_nearest_max_800"]) ``` + +
## compute_mixed_uses +
compute_mixed_uses
( @@ -513,14 +494,13 @@ print(nodes_gdf["cc_distance"])
-Compute landuse metrics. This function wraps the underlying `rust` optimised functions for aggregating and computing various mixed-use. These are computed simultaneously for any required combinations of measures (and distances). By default, hill and hill weighted measures will be computed, by the available flags e.g. `compute_hill` or `compute_shannon` can be used to configure which classes of measures should run. -See the accompanying paper on `arXiv` for additional information about methods for computing mixed-use measures at the pedestrian scale. + Compute landuse metrics. This function wraps the underlying `rust` optimised functions for aggregating and computing various mixed-use. These are computed simultaneously for any required combinations of measures (and distances). By default, hill and hill weighted measures will be computed, by the available flags e.g. `compute_hill` or `compute_shannon` can be used to configure which classes of measures should run. -The data is aggregated and computed over the street network, with the implication that mixed-use and land-use accessibility aggregations are generated from the same locations as for centrality computations, which can therefore be correlated or otherwise compared. The outputs of the calculations are written to the corresponding node indices in the same `node_gdf` `GeoDataFrame` used for centrality methods, and which will display the calculated metrics under correspondingly labelled columns. + See the accompanying paper on `arXiv` for additional information about methods for computing mixed-use measures at the pedestrian scale. + The data is aggregated and computed over the street network, with the implication that mixed-use and land-use accessibility aggregations are generated from the same locations as for centrality computations, which can therefore be correlated or otherwise compared. The outputs of the calculations are written to the corresponding node indices in the same `node_gdf` `GeoDataFrame` used for centrality methods, and which will display the calculated metrics under correspondingly labelled columns. ### Parameters -
data_gdf
@@ -528,8 +508,7 @@ The data is aggregated and computed over the street network, with the implicatio
-A [`GeoDataFrame`](https://geopandas.org/en/stable/docs/user_guide/data_structures.html#geodataframe) representing data points. The coordinates of data points should correspond as precisely as possible to the location of the feature in space; or, in the case of buildings, should ideally correspond to the location of the building entrance.
- + A [`GeoDataFrame`](https://geopandas.org/en/stable/docs/user_guide/data_structures.html#geodataframe) representing data points. The coordinates of data points should correspond as precisely as possible to the location of the feature in space; or, in the case of buildings, should ideally correspond to the location of the building entrance.
@@ -539,8 +518,7 @@ A [`GeoDataFrame`](https://geopandas.org/en/stable/docs/user_guide/data_structur
-The column label from which to take landuse categories, e.g. a column labelled "landuse_categories" might contain "shop", "pub", "school", etc., landuse categories.
- + The column label from which to take landuse categories, e.g. a column labelled "landuse_categories" might contain "shop", "pub", "school", etc., landuse categories.
@@ -550,8 +528,7 @@ The column label from which to take landuse categories, e.g. a column labelled &
-A [`GeoDataFrame`](https://geopandas.org/en/stable/docs/user_guide/data_structures.html#geodataframe) representing nodes. Best generated with the [`io.network_structure_from_nx`](/tools/io#network-structure-from-nx) function. The outputs of calculations will be written to this `GeoDataFrame`, which is then returned from the function.
- + A [`GeoDataFrame`](https://geopandas.org/en/stable/docs/user_guide/data_structures.html#geodataframe) representing nodes. Best generated with the [`io.network_structure_from_nx`](/tools/io#network-structure-from-nx) function. The outputs of calculations will be written to this `GeoDataFrame`, which is then returned from the function.
@@ -561,8 +538,7 @@ A [`GeoDataFrame`](https://geopandas.org/en/stable/docs/user_guide/data_structur
-A [`rustalgos.NetworkStructure`](/rustalgos/rustalgos#networkstructure). Best generated with the [`io.network_structure_from_nx`](/tools/io#network-structure-from-nx) function.
- + A [`rustalgos.NetworkStructure`](/rustalgos/rustalgos#networkstructure). Best generated with the [`io.network_structure_from_nx`](/tools/io#network-structure-from-nx) function.
@@ -572,8 +548,7 @@ A [`rustalgos.NetworkStructure`](/rustalgos/rustalgos#networkstructure). Best ge
-The maximum distance to consider when assigning respective data points to the nearest adjacent network nodes.
- + The maximum distance to consider when assigning respective data points to the nearest adjacent network nodes.
@@ -583,8 +558,7 @@ The maximum distance to consider when assigning respective data points to the ne
-Compute Hill diversity. This is the recommended form of diversity index. Computed for q of 0, 1, and 2.
- + Compute Hill diversity. This is the recommended form of diversity index. Computed for q of 0, 1, and 2.
@@ -594,8 +568,7 @@ Compute Hill diversity. This is the recommended form of diversity index. Compute
-Compute distance weighted Hill diversity. This is the recommended form of diversity index. Computed for q of 0, 1, and 2.
- + Compute distance weighted Hill diversity. This is the recommended form of diversity index. Computed for q of 0, 1, and 2.
@@ -605,8 +578,7 @@ Compute distance weighted Hill diversity. This is the recommended form of divers
-Compute shannon entropy. Hill diversity of q=1 is generally preferable.
- + Compute shannon entropy. Hill diversity of q=1 is generally preferable.
@@ -616,8 +588,7 @@ Compute shannon entropy. Hill diversity of q=1 is generally preferable.
-Compute the gini form of diversity index. Hill diversity of q=2 is generally preferable.
- + Compute the gini form of diversity index. Hill diversity of q=2 is generally preferable.
@@ -627,8 +598,7 @@ Compute the gini form of diversity index. Hill diversity of q=2 is generally pre
-Distances corresponding to the local $d_{max}$ thresholds to be used for calculations. The $\beta$ parameters (for distance-weighted metrics) will be determined implicitly. If the `distances` parameter is not provided, then the `beta` parameter must be provided instead.
- + Distances corresponding to the local $d_{max}$ thresholds to be used for calculations. The $\beta$ parameters (for distance-weighted metrics) will be determined implicitly. If the `distances` parameter is not provided, then the `beta` parameter must be provided instead.
@@ -638,8 +608,7 @@ Distances corresponding to the local $d_{max}$ thresholds to be used for calcula
-A $\beta$, or array of $\beta$ to be used for the exponential decay function for weighted metrics. The `distance` parameters for unweighted metrics will be determined implicitly. If the `betas` parameter is not provided, then the `distance` parameter must be provided instead.
- + A $\beta$, or array of $\beta$ to be used for the exponential decay function for weighted metrics. The `distance` parameters for unweighted metrics will be determined implicitly. If the `betas` parameter is not provided, then the `distance` parameter must be provided instead.
@@ -649,8 +618,7 @@ A $\beta$, or array of $\beta$ to be used for the exponential decay function for
-An optional column name for data point keys. This is used for deduplicating points representing a shared source of information. For example, where a single greenspace is represented by many entrances as datapoints, only the nearest entrance (from a respective location) will be considered (during aggregations) when the points share a datapoint identifier.
- + An optional column name for data point keys. This is used for deduplicating points representing a shared source of information. For example, where a single greenspace is represented by many entrances as datapoints, only the nearest entrance (from a respective location) will be considered (during aggregations) when the points share a datapoint identifier.
@@ -660,8 +628,7 @@ An optional column name for data point keys. This is used for deduplicating poin
-Whether to use a simplest-path heuristic in-lieu of a shortest-path heuristic when calculating aggregations and distances.
- + Whether to use a simplest-path heuristic in-lieu of a shortest-path heuristic when calculating aggregations and distances.
@@ -671,8 +638,7 @@ Whether to use a simplest-path heuristic in-lieu of a shortest-path heuristic wh
-Tolerance in metres indicating a spatial buffer for datapoint accuracy. Intended for situations where datapoint locations are not precise. If greater than zero, weighted functions will clip the spatial impedance curve above weights corresponding to the given spatial tolerance and normalises to the new range. For background, see [`rustalgos.clip_weights_curve`](/rustalgos#clip-weights-curve).
- + Tolerance in metres indicating a spatial buffer for datapoint accuracy. Intended for situations where datapoint locations are not precise. If greater than zero, weighted functions will clip the spatial impedance curve above weights corresponding to the given spatial tolerance and normalises to the new range. For background, see [`rustalgos.clip_weights_curve`](/rustalgos#clip-weights-curve).
@@ -682,8 +648,7 @@ Tolerance in metres indicating a spatial buffer for datapoint accuracy. Intended
-The default `min_threshold_wt` parameter can be overridden to generate custom mappings between the `distance` and `beta` parameters. See [`rustalgos.distances_from_beta`](/rustalgos#distances-from-betas) for more information.
- + The default `min_threshold_wt` parameter can be overridden to generate custom mappings between the `distance` and `beta` parameters. See [`rustalgos.distances_from_beta`](/rustalgos#distances-from-betas) for more information.
@@ -693,12 +658,10 @@ The default `min_threshold_wt` parameter can be overridden to generate custom ma
-The scale of random jitter to add to shortest path calculations, useful for situations with highly rectilinear grids or for smoothing metrics on messy network representations. A random sample is drawn from a range of zero to one and is then multiplied by the specified `jitter_scale`. This random value is added to the shortest path calculations to provide random variation to the paths traced through the network. When working with shortest paths in metres, the random value represents distance in metres. When using a simplest path heuristic, the jitter will represent angular change in degrees.
- + The scale of random jitter to add to shortest path calculations, useful for situations with highly rectilinear grids or for smoothing metrics on messy network representations. A random sample is drawn from a range of zero to one and is then multiplied by the specified `jitter_scale`. This random value is added to the shortest path calculations to provide random variation to the paths traced through the network. When working with shortest paths in metres, the random value represents distance in metres. When using a simplest path heuristic, the jitter will represent angular change in degrees. ### Returns -
nodes_gdf
@@ -706,8 +669,7 @@ The scale of random jitter to add to shortest path calculations, useful for situ
-The input `node_gdf` parameter is returned with additional columns populated with the calculated metrics.
- + The input `node_gdf` parameter is returned with additional columns populated with the calculated metrics.
@@ -717,29 +679,27 @@ The input `node_gdf` parameter is returned with additional columns populated wit
-The input `data_gdf` is returned with two additional columns: `nearest_assigned` and `next_nearest_assign`.
- + The input `data_gdf` is returned with two additional columns: `nearest_assigned` and `next_nearest_assign`. ### Notes -| key | formula | notes | -| ------- | :--------------------------------------------------------------------------------------------------------------------------------: | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| hill | $$q\geq{0},\ q\neq{1} \\ \big(\sum_{i}^{S}p_{i}^q\big)^{1/(1-q)} \\ lim_{q\to1} \\ exp\big(-\sum_{i}^{S}\ p_{i}\ log\ p_{i}\big)$$ | Hill diversity: this is the preferred form of diversity metric because it adheres to the replication principle and uses units of effective species instead of measures of information or uncertainty. The `q` parameter controls the degree of emphasis on the _richness_ of species as opposed to the _balance_ of species. Over-emphasis on balance can be misleading in an urban context, for which reason research finds support for using `q=0`: this reduces to a simple count of distinct land-uses. | -| hill_wt | $$\big[\sum_{i}^{S}d_{i}\big(\frac{p_{i}}{\bar{T}}\big)^{q} \big]^{1/(1-q)} \\ \bar{T} = \sum_{i}^{S}d_{i}p_{i}$$ | This is a distance-weighted variant of Hill Diversity based on the distances from the point of computation to the nearest example of a particular land-use. It therefore gives a locally representative indication of the intensity of mixed-uses. $d_{i}$ is a negative exponential function where $\beta$ controls the strength of the decay. ($\beta$ is provided by the `Network Layer`, see [`rustalgos.distances_from_beta`](/rustalgos#distances-from-betas).) | -| shannon | $$ -\sum*{i}^{S}\ p*{i}\ log\ p\_{i}$$ | Shannon diversity (or*information entropy*) is one of the classic diversity indices. Note that it is preferable to use Hill Diversity with `q=1`, which is effectively a transformation of Shannon diversity into units of effective species. | -| gini | $$ 1 - \sum*{i}^{S} p*{i}^2$$ | Gini-Simpson is another classic diversity index. It can behave problematically because it does not adhere to the replication principle and places emphasis on the balance of species, which can be counter-productive for purposes of measuring mixed-uses. Note that where an emphasis on balance is desired, it is preferable to use Hill Diversity with `q=2`, which is effectively a transformation of Gini-Simpson diversity into units of effective species. | +| key | formula | notes | +|-----|:-------:|-------| +| hill | $$q\geq{0},\ q\neq{1} \\ \big(\sum_{i}^{S}p_{i}^q\big)^{1/(1-q)} \\ lim_{q\to1} \\ exp\big(-\sum_{i}^{S}\ p_{i}\ log\ p_{i}\big)$$ | Hill diversity: this is the preferred form of diversity metric because it adheres to the replication principle and uses units of effective species instead of measures of information or uncertainty. The `q` parameter controls the degree of emphasis on the _richness_ of species as opposed to the _balance_ of species. Over-emphasis on balance can be misleading in an urban context, for which reason research finds support for using `q=0`: this reduces to a simple count of distinct land-uses.| +| hill_wt | $$\big[\sum_{i}^{S}d_{i}\big(\frac{p_{i}}{\bar{T}}\big)^{q} \big]^{1/(1-q)} \\ \bar{T} = \sum_{i}^{S}d_{i}p_{i}$$ | This is a distance-weighted variant of Hill Diversity based on the distances from the point of computation to the nearest example of a particular land-use. It therefore gives a locally representative indication of the intensity of mixed-uses. $d_{i}$ is a negative exponential function where $\beta$ controls the strength of the decay. ($\beta$ is provided by the `Network Layer`, see [`rustalgos.distances_from_beta`](/rustalgos#distances-from-betas).)| +| shannon | $$ -\sum_{i}^{S}\ p_{i}\ log\ p_{i}$$ | Shannon diversity (or_information entropy_) is one of the classic diversity indices. Note that it is preferable to use Hill Diversity with `q=1`, which is effectively a transformation of Shannon diversity into units of effective species.| +| gini | $$ 1 - \sum_{i}^{S} p_{i}^2$$ | Gini-Simpson is another classic diversity index. It can behave problematically because it does not adhere to the replication principle and places emphasis on the balance of species, which can be counter-productive for purposes of measuring mixed-uses. Note that where an emphasis on balance is desired, it is preferable to use Hill Diversity with `q=2`, which is effectively a transformation of Gini-Simpson diversity into units of effective species.| :::note -`hill_branch_wt` at `q=0` is generally the best choice for granular landuse data, or else `q=1` or +`hill_wt` at `q=0` is generally the best choice for granular landuse data, or else `q=1` or `q=2` for increasingly crude landuse classifications schemas. ::: -A worked example: - + A worked example: ```python from cityseer.metrics import networks, layers -from cityseer.tools import mock, graphs +from cityseer.tools import mock, graphs, io # prepare a mock graph G = mock.mock_graph() @@ -758,7 +718,7 @@ nodes_gdf, landuses_gdf = layers.compute_mixed_uses( # the data is written to the GeoDataFrame print(nodes_gdf.columns) # access accordingly, e.g. hill diversity at q=0 and 800m -print(nodes_gdf["cc_hill_q0_800"]) +print(nodes_gdf["cc_hill_q0_800_nw"]) ``` :::warning @@ -769,10 +729,12 @@ been applied. +
## compute_stats +
compute_stats
( @@ -843,10 +805,9 @@ been applied.
-Compute numerical statistics over the street network. This function wraps the underlying `rust` optimised function for computing statistical measures. The data is aggregated and computed over the street network relative to the network nodes, with the implication that statistical aggregations are generated from the same locations as for centrality computations, which can therefore be correlated or otherwise compared. + Compute numerical statistics over the street network. This function wraps the underlying `rust` optimised function for computing statistical measures. The data is aggregated and computed over the street network relative to the network nodes, with the implication that statistical aggregations are generated from the same locations as for centrality computations, which can therefore be correlated or otherwise compared. ### Parameters -
data_gdf
@@ -854,8 +815,7 @@ Compute numerical statistics over the street network. This function wraps the un
-A [`GeoDataFrame`](https://geopandas.org/en/stable/docs/user_guide/data_structures.html#geodataframe) representing data points. The coordinates of data points should correspond as precisely as possible to the location of the feature in space; or, in the case of buildings, should ideally correspond to the location of the building entrance.
- + A [`GeoDataFrame`](https://geopandas.org/en/stable/docs/user_guide/data_structures.html#geodataframe) representing data points. The coordinates of data points should correspond as precisely as possible to the location of the feature in space; or, in the case of buildings, should ideally correspond to the location of the building entrance.
@@ -865,8 +825,7 @@ A [`GeoDataFrame`](https://geopandas.org/en/stable/docs/user_guide/data_structur
-The column label corresponding to the column in `data_gdf` from which to take numerical information.
- + The column label corresponding to the column in `data_gdf` from which to take numerical information.
@@ -876,8 +835,7 @@ The column label corresponding to the column in `data_gdf` from which to take nu
-A [`GeoDataFrame`](https://geopandas.org/en/stable/docs/user_guide/data_structures.html#geodataframe) representing nodes. Best generated with the [`io.network_structure_from_nx`](/tools/io#network-structure-from-nx) function. The outputs of calculations will be written to this `GeoDataFrame`, which is then returned from the function.
- + A [`GeoDataFrame`](https://geopandas.org/en/stable/docs/user_guide/data_structures.html#geodataframe) representing nodes. Best generated with the [`io.network_structure_from_nx`](/tools/io#network-structure-from-nx) function. The outputs of calculations will be written to this `GeoDataFrame`, which is then returned from the function.
@@ -887,8 +845,7 @@ A [`GeoDataFrame`](https://geopandas.org/en/stable/docs/user_guide/data_structur
-A [`rustalgos.NetworkStructure`](/rustalgos/rustalgos#networkstructure). Best generated with the [`io.network_structure_from_nx`](/tools/io#network-structure-from-nx) function.
- + A [`rustalgos.NetworkStructure`](/rustalgos/rustalgos#networkstructure). Best generated with the [`io.network_structure_from_nx`](/tools/io#network-structure-from-nx) function.
@@ -898,8 +855,7 @@ A [`rustalgos.NetworkStructure`](/rustalgos/rustalgos#networkstructure). Best ge
-The maximum distance to consider when assigning respective data points to the nearest adjacent network nodes.
- + The maximum distance to consider when assigning respective data points to the nearest adjacent network nodes.
@@ -909,8 +865,7 @@ The maximum distance to consider when assigning respective data points to the ne
-Distances corresponding to the local $d_{max}$ thresholds to be used for calculations. The $\beta$ parameters (for distance-weighted metrics) will be determined implicitly. If the `distances` parameter is not provided, then the `beta` parameter must be provided instead.
- + Distances corresponding to the local $d_{max}$ thresholds to be used for calculations. The $\beta$ parameters (for distance-weighted metrics) will be determined implicitly. If the `distances` parameter is not provided, then the `beta` parameter must be provided instead.
@@ -920,8 +875,7 @@ Distances corresponding to the local $d_{max}$ thresholds to be used for calcula
-A $\beta$, or array of $\beta$ to be used for the exponential decay function for weighted metrics. The `distance` parameters for unweighted metrics will be determined implicitly. If the `betas` parameter is not provided, then the `distance` parameter must be provided instead.
- + A $\beta$, or array of $\beta$ to be used for the exponential decay function for weighted metrics. The `distance` parameters for unweighted metrics will be determined implicitly. If the `betas` parameter is not provided, then the `distance` parameter must be provided instead.
@@ -931,8 +885,7 @@ A $\beta$, or array of $\beta$ to be used for the exponential decay function for
-An optional column name for data point keys. This is used for deduplicating points representing a shared source of information. For example, where a single greenspace is represented by many entrances as datapoints, only the nearest entrance (from a respective location) will be considered (during aggregations) when the points share a datapoint identifier.
- + An optional column name for data point keys. This is used for deduplicating points representing a shared source of information. For example, where a single greenspace is represented by many entrances as datapoints, only the nearest entrance (from a respective location) will be considered (during aggregations) when the points share a datapoint identifier.
@@ -942,8 +895,7 @@ An optional column name for data point keys. This is used for deduplicating poin
-Whether to use a simplest-path heuristic in-lieu of a shortest-path heuristic when calculating aggregations and distances.
- + Whether to use a simplest-path heuristic in-lieu of a shortest-path heuristic when calculating aggregations and distances.
@@ -953,8 +905,7 @@ Whether to use a simplest-path heuristic in-lieu of a shortest-path heuristic wh
-Tolerance in metres indicating a spatial buffer for datapoint accuracy. Intended for situations where datapoint locations are not precise. If greater than zero, weighted functions will clip the spatial impedance curve above weights corresponding to the given spatial tolerance and normalises to the new range. For background, see [`rustalgos.clip_weights_curve`](/rustalgos#clip-weights-curve).
- + Tolerance in metres indicating a spatial buffer for datapoint accuracy. Intended for situations where datapoint locations are not precise. If greater than zero, weighted functions will clip the spatial impedance curve above weights corresponding to the given spatial tolerance and normalises to the new range. For background, see [`rustalgos.clip_weights_curve`](/rustalgos#clip-weights-curve).
@@ -964,8 +915,7 @@ Tolerance in metres indicating a spatial buffer for datapoint accuracy. Intended
-The default `min_threshold_wt` parameter can be overridden to generate custom mappings between the `distance` and `beta` parameters. See [`rustalgos.distances_from_beta`](/rustalgos#distances-from-betas) for more information.
- + The default `min_threshold_wt` parameter can be overridden to generate custom mappings between the `distance` and `beta` parameters. See [`rustalgos.distances_from_beta`](/rustalgos#distances-from-betas) for more information.
@@ -975,12 +925,10 @@ The default `min_threshold_wt` parameter can be overridden to generate custom ma
-The scale of random jitter to add to shortest path calculations, useful for situations with highly rectilinear grids or for smoothing metrics on messy network representations. A random sample is drawn from a range of zero to one and is then multiplied by the specified `jitter_scale`. This random value is added to the shortest path calculations to provide random variation to the paths traced through the network. When working with shortest paths in metres, the random value represents distance in metres. When using a simplest path heuristic, the jitter will represent angular change in degrees.
- + The scale of random jitter to add to shortest path calculations, useful for situations with highly rectilinear grids or for smoothing metrics on messy network representations. A random sample is drawn from a range of zero to one and is then multiplied by the specified `jitter_scale`. This random value is added to the shortest path calculations to provide random variation to the paths traced through the network. When working with shortest paths in metres, the random value represents distance in metres. When using a simplest path heuristic, the jitter will represent angular change in degrees. ### Returns -
nodes_gdf
@@ -988,8 +936,7 @@ The scale of random jitter to add to shortest path calculations, useful for situ
-The input `node_gdf` parameter is returned with additional columns populated with the calcualted metrics.
- + The input `node_gdf` parameter is returned with additional columns populated with the calcualted metrics.
@@ -999,17 +946,16 @@ The input `node_gdf` parameter is returned with additional columns populated wit
-The input `data_gdf` is returned with two additional columns: `nearest_assigned` and `next_neareset_assign`.
- + The input `data_gdf` is returned with two additional columns: `nearest_assigned` and `next_neareset_assign`. ### Notes -A worked example: + A worked example: ```python from cityseer.metrics import networks, layers -from cityseer.tools import mock, graphs +from cityseer.tools import mock, graphs, io # prepare a mock graph G = mock.mock_graph() @@ -1027,21 +973,23 @@ nodes_gdf, numerical_gdf = layers.compute_stats( ) print(nodes_gdf.columns) # weighted form -print(nodes_gdf["cc_mock_numerical_1_mean_wt_400"]) +print(nodes_gdf["cc_mock_numerical_1_mean_400_wt"]) # non-weighted form -print(nodes_gdf["cc_mock_numerical_1_sum_200"]) +print(nodes_gdf["cc_mock_numerical_1_mean_400_nw"]) ``` + :::note The following stat types will be available for each `stats_key` for each of the computed distances: - - `max` and `min` -- `sum` and `sum_weighted` -- `mean` and `mean_weighted` -- `variance` and `variance_weighted` - ::: +- `sum` and `sum_wt` +- `mean` and `mean_wt` +- `variance` and `variance_wt` +::: + +
diff --git a/docs/src/pages/metrics/networks.md b/docs/src/pages/metrics/networks.md index f615bd57..aa4cbf34 100644 --- a/docs/src/pages/metrics/networks.md +++ b/docs/src/pages/metrics/networks.md @@ -1,61 +1,63 @@ --- layout: ../../layouts/PageLayout.astro --- -
# networks -Compute network centralities. There are three network centrality methods available depending on whether you're using a node-based or segment-based approach, with the former available in both shortest and simplest (angular) variants. + + Compute network centralities. There are three network centrality methods available depending on whether you're using a node-based or segment-based approach, with the former available in both shortest and simplest (angular) variants. - [`node_centrality_shortest`](#node-centrality-shortest) - [`node_centrality_simplest`](#node-centrality-simplest) - [`segment_centrality`](#segment-centrality) -These methods wrap the underlying `rust` optimised functions for computing centralities. Multiple classes of measures and distances are computed simultaneously to reduce the amount of time required for multi-variable and multi-scalar strategies. + These methods wrap the underlying `rust` optimised functions for computing centralities. Multiple classes of measures and distances are computed simultaneously to reduce the amount of time required for multi-variable and multi-scalar strategies. -See the accompanying paper on `arXiv` for additional information about methods for computing centrality measures. + See the accompanying paper on `arXiv` for additional information about methods for computing centrality measures. :::note The reasons for picking one approach over another are varied: - Node based centralities compute the measures relative to each reachable node within the threshold distances. For - this reason, they can be susceptible to distortions caused by messy graph topologies such redundant and varied - concentrations of degree=2 nodes (e.g. to describe roadway geometry) or needlessly complex representations of - street intersections. In these cases, the network should first be cleaned using methods such as those available in - the [`graph`](/tools/graphs) module (see the [Graph Cleaning](https://benchmark-urbanism.github.io/cityseer-examples/examples/graph_cleaning.html) guide for examples). If a - network topology has varied intensities of nodes but the street segments are less spurious, then segmentised methods - can be preferable because they are based on segment distances: segment aggregations remain the same regardless of - the number of intervening nodes, however, are not immune from situations such as needlessly complex representations - of roadway intersections or a proliferation of walking paths in greenspaces; +this reason, they can be susceptible to distortions caused by messy graph topologies such redundant and varied +concentrations of degree=2 nodes (e.g. to describe roadway geometry) or needlessly complex representations of +street intersections. In these cases, the network should first be cleaned using methods such as those available in +the [`graph`](/tools/graphs) module (see the [graph cleaning guide](/guide#graph-cleaning) for examples). If a +network topology has varied intensities of nodes but the street segments are less spurious, then segmentised methods +can be preferable because they are based on segment distances: segment aggregations remain the same regardless of +the number of intervening nodes, however, are not immune from situations such as needlessly complex representations +of roadway intersections or a proliferation of walking paths in greenspaces; - Node-based `harmonic` centrality can be problematic on graphs where nodes are erroneously placed too close - together or where impedances otherwise approach zero, as may be the case for simplest-path measures or small - distance thesholds. This happens because the outcome of the division step can balloon towards $\infty$ once - impedances decrease below 1. +together or where impedances otherwise approach zero, as may be the case for simplest-path measures or small +distance thesholds. This happens because the outcome of the division step can balloon towards $\infty$ once +impedances decrease below 1. - Note that `cityseer`'s implementation of simplest (angular) measures work on both primal and dual graphs (node only). - Measures should only be directly compared on the same topology because different topologies can otherwise affect - the expression of a measure. Accordingly, measures computed on dual graphs cannot be compared to measures computed - on primal graphs because this does not account for the impact of differing topologies. Dual graph representations - can have substantially greater numbers of nodes and edges for the same underlying street network; for example, a - four-way intersection consisting of one node with four edges translates to four nodes and six edges on the dual. - This effect is amplified for denser regions of the network. +the expression of a measure. Accordingly, measures computed on dual graphs cannot be compared to measures computed +on primal graphs because this does not account for the impact of differing topologies. Dual graph representations +can have substantially greater numbers of nodes and edges for the same underlying street network; for example, a +four-way intersection consisting of one node with four edges translates to four nodes and six edges on the dual. +This effect is amplified for denser regions of the network. - Segmentised versions of centrality measures should not be computed on dual graph topologies because street segment - lengths would be duplicated for each permutation of dual edge spanning street intersections. By way of example, - the contribution of a single edge segment at a four-way intersection would be duplicated three times. +lengths would be duplicated for each permutation of dual edge spanning street intersections. By way of example, +the contribution of a single edge segment at a four-way intersection would be duplicated three times. - The usual formulations of closeness or normalised closeness are discouraged because these do not behave - suitably for localised graphs. Harmonic closeness or Hillier normalisation (which resembles a simplified form of - Improved Closeness Centrality proposed by Wasserman and Faust) should be used instead. +suitably for localised graphs. Harmonic closeness or Hillier normalisation (which resembles a simplified form of +Improved Closeness Centrality proposed by Wasserman and Faust) should be used instead. - Network decomposition can be a useful strategy when working at small distance thresholds, and confers advantages - such as more regularly spaced snapshots and fewer artefacts at small distance thresholds where street edges - intersect distance thresholds. However, the regular spacing of the decomposed segments will introduce spikes in the - distributions of node-based centrality measures when working at very small distance thresholds. Segmentised versions - may therefore be preferable when working at small thresholds on decomposed networks. - ::: +such as more regularly spaced snapshots and fewer artefacts at small distance thresholds where street edges +intersect distance thresholds. However, the regular spacing of the decomposed segments will introduce spikes in the +distributions of node-based centrality measures when working at very small distance thresholds. Segmentised versions +may therefore be preferable when working at small thresholds on decomposed networks. +::: +
## node_centrality_shortest +
node_centrality_shortest
( @@ -105,14 +107,13 @@ The reasons for picking one approach over another are varied:
-Compute node-based network centrality using the shortest path heuristic. + + Compute node-based network centrality using the shortest path heuristic. :::note Node weights are taken into account when computing centralities. These would typically be initialised at 1 unless manually specified. ::: - ### Parameters -
network_structure
@@ -120,8 +121,7 @@ manually specified.
-A [`rustalgos.NetworkStructure`](/rustalgos/rustalgos#networkstructure). Best generated with the [`io.network_structure_from_nx`](/tools/io#network-structure-from-nx) method.
- + A [`rustalgos.NetworkStructure`](/rustalgos/rustalgos#networkstructure). Best generated with the [`io.network_structure_from_nx`](/tools/io#network-structure-from-nx) method.
@@ -131,8 +131,7 @@ A [`rustalgos.NetworkStructure`](/rustalgos/rustalgos#networkstructure). Best ge
-A [`GeoDataFrame`](https://geopandas.org/en/stable/docs/user_guide/data_structures.html#geodataframe) representing nodes. Best generated with the [`io.network_structure_from_nx`](/tools/io#network-structure-from-nx) method. The outputs of calculations will be written to this `GeoDataFrame`, which is then returned from the method.
- + A [`GeoDataFrame`](https://geopandas.org/en/stable/docs/user_guide/data_structures.html#geodataframe) representing nodes. Best generated with the [`io.network_structure_from_nx`](/tools/io#network-structure-from-nx) method. The outputs of calculations will be written to this `GeoDataFrame`, which is then returned from the method.
@@ -142,8 +141,7 @@ A [`GeoDataFrame`](https://geopandas.org/en/stable/docs/user_guide/data_structur
-Distances corresponding to the local $d_{max}$ thresholds to be used for calculations. The $\beta$ parameters (for distance-weighted metrics) will be determined implicitly. If the `distances` parameter is not provided, then the `beta` parameter must be provided instead.
- + Distances corresponding to the local $d_{max}$ thresholds to be used for calculations. The $\beta$ parameters (for distance-weighted metrics) will be determined implicitly. If the `distances` parameter is not provided, then the `beta` parameter must be provided instead.
@@ -153,8 +151,7 @@ Distances corresponding to the local $d_{max}$ thresholds to be used for calcula
-A $\beta$, or array of $\beta$ to be used for the exponential decay function for weighted metrics. The `distance` parameters for unweighted metrics will be determined implicitly. If the `betas` parameter is not provided, then the `distance` parameter must be provided instead.
- + A $\beta$, or array of $\beta$ to be used for the exponential decay function for weighted metrics. The `distance` parameters for unweighted metrics will be determined implicitly. If the `betas` parameter is not provided, then the `distance` parameter must be provided instead.
@@ -164,8 +161,7 @@ A $\beta$, or array of $\beta$ to be used for the exponential decay function for
-Compute closeness centralities. True by default.
- + Compute closeness centralities. True by default.
@@ -175,8 +171,7 @@ Compute closeness centralities. True by default.
-Compute betweenness centralities. True by default.
- + Compute betweenness centralities. True by default.
@@ -186,8 +181,7 @@ Compute betweenness centralities. True by default.
-The default `min_threshold_wt` parameter can be overridden to generate custom mappings between the `distance` and `beta` parameters. See [`rustalgos.distances_from_beta`](/rustalgos#distances-from-betas) for more information.
- + The default `min_threshold_wt` parameter can be overridden to generate custom mappings between the `distance` and `beta` parameters. See [`rustalgos.distances_from_beta`](/rustalgos#distances-from-betas) for more information.
@@ -197,12 +191,10 @@ The default `min_threshold_wt` parameter can be overridden to generate custom ma
-The scale of random jitter to add to shortest path calculations, useful for situations with highly rectilinear grids or for smoothing metrics on messy network representations. A random sample is drawn from a range of zero to one and is then multiplied by the specified `jitter_scale`. This random value is added to the shortest path calculations to provide random variation to the paths traced through the network. When working with shortest paths in metres, the random value represents distance in metres. When using a simplest path heuristic, the jitter will represent angular change in degrees.
- + The scale of random jitter to add to shortest path calculations, useful for situations with highly rectilinear grids or for smoothing metrics on messy network representations. A random sample is drawn from a range of zero to one and is then multiplied by the specified `jitter_scale`. This random value is added to the shortest path calculations to provide random variation to the paths traced through the network. When working with shortest paths in metres, the random value represents distance in metres. When using a simplest path heuristic, the jitter will represent angular change in degrees. ### Returns -
nodes_gdf
@@ -210,31 +202,32 @@ The scale of random jitter to add to shortest path calculations, useful for situ
-The input `node_gdf` parameter is returned with additional columns populated with the calcualted metrics.
- + The input `node_gdf` parameter is returned with additional columns populated with the calcualted metrics.
### Notes -The following keys use the shortest-path heuristic: + The following keys use the shortest-path heuristic: -| key | formula | notes | -| ---------------- | :---------------------------------------------------------------------------: | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| density | $$\sum_{j\neq{i}}^{n}1$$ | A summation of nodes. | -| harmonic | $$\sum_{j\neq{i}}^{n}\frac{1}{d_{(i,j)}}$$ | Harmonic closeness is an appropriate form of closeness centrality for localised implementations constrained by the threshold $d_{max}$. | -| hillier | $$\frac{(n-1)^2}{\sum_{j \neq i}^{n} d_{(i,j)}}$$ | The square of node density divided by farness. This is also a simplified form of Improved Closeness Centrality. | -| beta | $$\sum_{j\neq{i}}^{n} \\ \exp(-\beta\cdot d[i,j])$$ | Also known as the gravity index. This is a spatial impedance metric differentiated from other closeness centralities by the use of an explicit $\beta$ parameter, which can be used to model the decay in walking tolerance as distances increase. | -| cycles | $$\sum_{j\neq{i}j=cycle}^{n}1$$ | A summation of network cycles. | -| farness | $$\sum_{j\neq{i}}^{n}d_{(i,j)}$$ | A summation of distances in metres. | -| betweenness | $$\sum_{j\neq{i}}^{n}\sum_{k\neq{j}\neq{i}}^{n}1$$ | Betweenness centrality summing all shortest-paths traversing each node $i$. | -| betweenness_beta | $$\sum_{j\neq{i}}^{n}\sum_{k\neq{j}\neq{i}}^{n} \\ \exp(-\beta\cdot d[j,k])$$ | Applies a spatial impedance decay function to betweenness centrality. $d$ represents the full distance from any $j$ to $k$ node pair passing through node $i$. | +| key | formula | notes | +| ----------------------| :------:| ----- | +| density | $$\sum_{j\neq{i}}^{n}1$$ | A summation of nodes. | +| harmonic | $$\sum_{j\neq{i}}^{n}\frac{1}{d_{(i,j)}}$$ | Harmonic closeness is an appropriate form of closeness centrality for localised implementations constrained by the threshold $d_{max}$. | +| hillier | $$\frac{(n-1)^2}{\sum_{j \neq i}^{n} d_{(i,j)}}$$ | The square of node density divided by farness. This is also a simplified form of Improved Closeness Centrality. | +| beta | $$\sum_{j\neq{i}}^{n} \\ \exp(-\beta\cdot d[i,j])$$ | Also known as the gravity index. This is a spatial impedance metric differentiated from other closeness centralities by the use of an explicit $\beta$ parameter, which can be used to model the decay in walking tolerance as distances increase. | +| cycles | $$\sum_{j\neq{i}j=cycle}^{n}1$$ | A summation of network cycles. | +| farness | $$\sum_{j\neq{i}}^{n}d_{(i,j)}$$ | A summation of distances in metres. | +| betweenness | $$\sum_{j\neq{i}}^{n}\sum_{k\neq{j}\neq{i}}^{n}1$$ | Betweenness centrality summing all shortest-paths traversing each node $i$. | +| betweenness_beta | $$\sum_{j\neq{i}}^{n}\sum_{k\neq{j}\neq{i}}^{n} \\ \exp(-\beta\cdot d[j,k])$$ | Applies a spatial impedance decay function to betweenness centrality. $d$ represents the full distance from any $j$ to $k$ node pair passing through node $i$. | +
## node_centrality_simplest +
node_centrality_simplest
( @@ -284,14 +277,13 @@ The following keys use the shortest-path heuristic:
-Compute node-based network centrality using the simplest path (angular) heuristic. + + Compute node-based network centrality using the simplest path (angular) heuristic. :::note Node weights are taken into account when computing centralities. These would typically be initialised at 1 unless manually specified. ::: - ### Parameters -
network_structure
@@ -299,8 +291,7 @@ manually specified.
-A [`rustalgos.NetworkStructure`](/rustalgos/rustalgos#networkstructure). Best generated with the [`io.network_structure_from_nx`](/tools/io#network-structure-from-nx) method.
- + A [`rustalgos.NetworkStructure`](/rustalgos/rustalgos#networkstructure). Best generated with the [`io.network_structure_from_nx`](/tools/io#network-structure-from-nx) method.
@@ -310,8 +301,7 @@ A [`rustalgos.NetworkStructure`](/rustalgos/rustalgos#networkstructure). Best ge
-A [`GeoDataFrame`](https://geopandas.org/en/stable/docs/user_guide/data_structures.html#geodataframe) representing nodes. Best generated with the [`io.network_structure_from_nx`](/tools/io#network-structure-from-nx) method. The outputs of calculations will be written to this `GeoDataFrame`, which is then returned from the method.
- + A [`GeoDataFrame`](https://geopandas.org/en/stable/docs/user_guide/data_structures.html#geodataframe) representing nodes. Best generated with the [`io.network_structure_from_nx`](/tools/io#network-structure-from-nx) method. The outputs of calculations will be written to this `GeoDataFrame`, which is then returned from the method.
@@ -321,8 +311,7 @@ A [`GeoDataFrame`](https://geopandas.org/en/stable/docs/user_guide/data_structur
-Distances corresponding to the local $d_{max}$ thresholds to be used for calculations. The $\beta$ parameters (for distance-weighted metrics) will be determined implicitly. If the `distances` parameter is not provided, then the `beta` parameter must be provided instead.
- + Distances corresponding to the local $d_{max}$ thresholds to be used for calculations. The $\beta$ parameters (for distance-weighted metrics) will be determined implicitly. If the `distances` parameter is not provided, then the `beta` parameter must be provided instead.
@@ -332,8 +321,7 @@ Distances corresponding to the local $d_{max}$ thresholds to be used for calcula
-A $\beta$, or array of $\beta$ to be used for the exponential decay function for weighted metrics. The `distance` parameters for unweighted metrics will be determined implicitly. If the `betas` parameter is not provided, then the `distance` parameter must be provided instead.
- + A $\beta$, or array of $\beta$ to be used for the exponential decay function for weighted metrics. The `distance` parameters for unweighted metrics will be determined implicitly. If the `betas` parameter is not provided, then the `distance` parameter must be provided instead.
@@ -343,8 +331,7 @@ A $\beta$, or array of $\beta$ to be used for the exponential decay function for
-Compute closeness centralities. True by default.
- + Compute closeness centralities. True by default.
@@ -354,8 +341,7 @@ Compute closeness centralities. True by default.
-Compute betweenness centralities. True by default.
- + Compute betweenness centralities. True by default.
@@ -365,8 +351,7 @@ Compute betweenness centralities. True by default.
-The default `min_threshold_wt` parameter can be overridden to generate custom mappings between the `distance` and `beta` parameters. See [`rustalgos.distances_from_beta`](/rustalgos#distances-from-betas) for more information.
- + The default `min_threshold_wt` parameter can be overridden to generate custom mappings between the `distance` and `beta` parameters. See [`rustalgos.distances_from_beta`](/rustalgos#distances-from-betas) for more information.
@@ -376,12 +361,10 @@ The default `min_threshold_wt` parameter can be overridden to generate custom ma
-The scale of random jitter to add to shortest path calculations, useful for situations with highly rectilinear grids or for smoothing metrics on messy network representations. A random sample is drawn from a range of zero to one and is then multiplied by the specified `jitter_scale`. This random value is added to the shortest path calculations to provide random variation to the paths traced through the network. When working with shortest paths in metres, the random value represents distance in metres. When using a simplest path heuristic, the jitter will represent angular change in degrees.
- + The scale of random jitter to add to shortest path calculations, useful for situations with highly rectilinear grids or for smoothing metrics on messy network representations. A random sample is drawn from a range of zero to one and is then multiplied by the specified `jitter_scale`. This random value is added to the shortest path calculations to provide random variation to the paths traced through the network. When working with shortest paths in metres, the random value represents distance in metres. When using a simplest path heuristic, the jitter will represent angular change in degrees. ### Returns -
nodes_gdf
@@ -389,30 +372,31 @@ The scale of random jitter to add to shortest path calculations, useful for situ
-The input `node_gdf` parameter is returned with additional columns populated with the calcualted metrics.
- + The input `node_gdf` parameter is returned with additional columns populated with the calcualted metrics.
### Notes -The following keys use the simplest-path heuristic: + The following keys use the simplest-path heuristic: -| key | formula | notes | -| ------------------------- | :------------------------------------------------: | --------------------------------------------------------------------------------------------------------------------------------------- | -| node_density_simplest | $$\sum_{j\neq{i}}^{n}1$$ | A summation of nodes. | -| node_harmonic_simplest | $$\sum_{j\neq{i}}^{n}\frac{1}{d_{(i,j)}}$$ | Harmonic closeness is an appropriate form of closeness centrality for localised implementations constrained by the threshold $d_{max}$. | -| node_hillier_simplest | $$\frac{(n-1)^2}{\sum_{j \neq i}^{n} d_{(i,j)}}$$ | The square of node density divided by farness. This is also a simplified form of Improved Closeness Centrality. | -| node_farness_simplest | $$\sum_{j\neq{i}}^{n}d_{(i,j)}$$ | A summation of distances in metres. | -| node_betweenness_simplest | $$\sum_{j\neq{i}}^{n}\sum_{k\neq{j}\neq{i}}^{n}1$$ | Betweenness centrality summing all shortest-paths traversing each node $i$. | +| key | formula | notes | +| ----------------------| :------:| ----- | +| density_ang | $$\sum_{j\neq{i}}^{n}1$$ | A summation of nodes. | +| harmonic_ang | $$\sum_{j\neq{i}}^{n}\frac{1}{d_{(i,j)}}$$ | Harmonic closeness is an appropriate form of closeness centrality for localised implementations constrained by the threshold $d_{max}$. | +| hillier_ang | $$\frac{(n-1)^2}{\sum_{j \neq i}^{n} d_{(i,j)}}$$ | The square of node density divided by farness. This is also a simplified form of Improved Closeness Centrality. | +| farness_ang | $$\sum_{j\neq{i}}^{n}d_{(i,j)}$$ | A summation of distances in metres. | +| betweenness_ang | $$\sum_{j\neq{i}}^{n}\sum_{k\neq{j}\neq{i}}^{n}1$$ | Betweenness centrality summing all shortest-paths traversing each node $i$. | The following keys use the simplest-path (shortest-angular-path) heuristic, and are available when the `angular` parameter is explicitly set to `True`: +
## segment_centrality +
segment_centrality
( @@ -462,12 +446,11 @@ The following keys use the simplest-path (shortest-angular-path) heuristic, and
-Compute segment-based network centrality using the shortest path heuristic. > Simplest path heuristics introduce conceptual and practical complications and support is deprecated since v4. -> For conceptual and practical reasons, segment based centralities are not weighted by node weights. + Compute segment-based network centrality using the shortest path heuristic. > Simplest path heuristics introduce conceptual and practical complications and support is deprecated since v4. + > For conceptual and practical reasons, segment based centralities are not weighted by node weights. ### Parameters -
network_structure
@@ -475,8 +458,7 @@ Compute segment-based network centrality using the shortest path heuristic. > Si
-A [`rustalgos.NetworkStructure`](/rustalgos/rustalgos#networkstructure). Best generated with the [`io.network_structure_from_nx`](/tools/io#network-structure-from-nx) method.
- + A [`rustalgos.NetworkStructure`](/rustalgos/rustalgos#networkstructure). Best generated with the [`io.network_structure_from_nx`](/tools/io#network-structure-from-nx) method.
@@ -486,8 +468,7 @@ A [`rustalgos.NetworkStructure`](/rustalgos/rustalgos#networkstructure). Best ge
-A [`GeoDataFrame`](https://geopandas.org/en/stable/docs/user_guide/data_structures.html#geodataframe) representing nodes. Best generated with the [`io.network_structure_from_nx`](/tools/io#network-structure-from-nx) method. The outputs of calculations will be written to this `GeoDataFrame`, which is then returned from the method.
- + A [`GeoDataFrame`](https://geopandas.org/en/stable/docs/user_guide/data_structures.html#geodataframe) representing nodes. Best generated with the [`io.network_structure_from_nx`](/tools/io#network-structure-from-nx) method. The outputs of calculations will be written to this `GeoDataFrame`, which is then returned from the method.
@@ -497,8 +478,7 @@ A [`GeoDataFrame`](https://geopandas.org/en/stable/docs/user_guide/data_structur
-Distances corresponding to the local $d_{max}$ thresholds to be used for calculations. The $\beta$ parameters (for distance-weighted metrics) will be determined implicitly. If the `distances` parameter is not provided, then the `beta` parameter must be provided instead.
- + Distances corresponding to the local $d_{max}$ thresholds to be used for calculations. The $\beta$ parameters (for distance-weighted metrics) will be determined implicitly. If the `distances` parameter is not provided, then the `beta` parameter must be provided instead.
@@ -508,8 +488,7 @@ Distances corresponding to the local $d_{max}$ thresholds to be used for calcula
-A $\beta$, or array of $\beta$ to be used for the exponential decay function for weighted metrics. The `distance` parameters for unweighted metrics will be determined implicitly. If the `betas` parameter is not provided, then the `distance` parameter must be provided instead.
- + A $\beta$, or array of $\beta$ to be used for the exponential decay function for weighted metrics. The `distance` parameters for unweighted metrics will be determined implicitly. If the `betas` parameter is not provided, then the `distance` parameter must be provided instead.
@@ -519,8 +498,7 @@ A $\beta$, or array of $\beta$ to be used for the exponential decay function for
-Compute closeness centralities. True by default.
- + Compute closeness centralities. True by default.
@@ -530,8 +508,7 @@ Compute closeness centralities. True by default.
-Compute betweenness centralities. True by default.
- + Compute betweenness centralities. True by default.
@@ -541,8 +518,7 @@ Compute betweenness centralities. True by default.
-The default `min_threshold_wt` parameter can be overridden to generate custom mappings between the `distance` and `beta` parameters. See [`rustalgos.distances_from_beta`](/rustalgos#distances-from-betas) for more information.
- + The default `min_threshold_wt` parameter can be overridden to generate custom mappings between the `distance` and `beta` parameters. See [`rustalgos.distances_from_beta`](/rustalgos#distances-from-betas) for more information.
@@ -552,12 +528,10 @@ The default `min_threshold_wt` parameter can be overridden to generate custom ma
-The scale of random jitter to add to shortest path calculations, useful for situations with highly rectilinear grids or for smoothing metrics on messy network representations. A random sample is drawn from a range of zero to one and is then multiplied by the specified `jitter_scale`. This random value is added to the shortest path calculations to provide random variation to the paths traced through the network. When working with shortest paths in metres, the random value represents distance in metres. When using a simplest path heuristic, the jitter will represent angular change in degrees.
- + The scale of random jitter to add to shortest path calculations, useful for situations with highly rectilinear grids or for smoothing metrics on messy network representations. A random sample is drawn from a range of zero to one and is then multiplied by the specified `jitter_scale`. This random value is added to the shortest path calculations to provide random variation to the paths traced through the network. When working with shortest paths in metres, the random value represents distance in metres. When using a simplest path heuristic, the jitter will represent angular change in degrees. ### Returns -
nodes_gdf
@@ -565,21 +539,22 @@ The scale of random jitter to add to shortest path calculations, useful for situ
-The input `node_gdf` parameter is returned with additional columns populated with the calcualted metrics.
- + The input `node_gdf` parameter is returned with additional columns populated with the calcualted metrics.
### Notes -Segment path centralities are available with the following keys: + Segment path centralities are available with the following keys: -| key | formula | notes | -| ------------------- | :------------------------------------------------------------------------------------------: | --------------------------------------------------------------------------------------------------------------------------------------------------------- | -| segment_density | $$\sum_{(a, b)}^{edges}d_{b} - d_{a}$$ | A summation of edge lengths. | -| segment_harmonic | $$\sum_{(a, b)}^{edges}\int_{a}^{b}\ln(b) -\ln(a)$$ | A continuous form of harmonic closeness centrality applied to edge lengths. | -| segment_beta | $$\sum_{(a, b)}^{edges}\int_{a}^{b}\frac{\exp(-\beta\cdot b) -\exp(-\beta\cdot a)}{-\beta}$$ | A # pylint: disable=line-too-long continuous form of beta-weighted (gravity index) centrality applied to edge lengths. | -| segment_betweenness | | A continuous form of betweenness: Resembles `segment_beta` applied to edges situated on shortest paths between all nodes $j$ and $k$ passing through $i$. | +| key | formula | notes | +| ------------------- | :-----: |------ | +| seg_density | $$\sum_{(a, b)}^{edges}d_{b} - d_{a}$$ | A summation of edge lengths. | +| seg_harmonic | $$\sum_{(a, b)}^{edges}\int_{a}^{b}\ln(b) -\ln(a)$$ | A continuous form of harmonic closeness centrality applied to edge lengths. | +| seg_beta | $$\sum_{(a, b)}^{edges}\int_{a}^{b}\frac{\exp(-\beta\cdot b) -\exp(-\beta\cdot a)}{-\beta}$$ | A # pylint: disable=line-too-long continuous form of beta-weighted (gravity index) centrality applied to edge lengths. | +| seg_betweenness | | A continuous form of betweenness: Resembles `segment_beta` applied to edges situated on shortest paths between all nodes $j$ and $k$ passing through $i$. | + +
diff --git a/docs/src/pages/rustalgos/rustalgos.md b/docs/src/pages/rustalgos/rustalgos.md index 59652702..26fcde44 100644 --- a/docs/src/pages/rustalgos/rustalgos.md +++ b/docs/src/pages/rustalgos/rustalgos.md @@ -1875,11 +1875,11 @@ datapoints are not located with high spatial precision.
-## shortest_path_tree +## dijkstra_tree_shortest
-shortest_path_tree
+dijkstra_tree_shortest
(
self @@ -1895,9 +1895,78 @@ datapoints are not located with high spatial precision. int
- angular + jitter_scale : - bool | None = None + float | None = None +
+ )->[ + ist[int] + NodeVisit + ] +
+
+ +
+ + + +
+ +## dijkstra_tree_simplest + + +
+dijkstra_tree_simplest
+ ( +
+ self +
+
+ src_idx + : + int +
+
+ max_dist + : + int +
+
+ jitter_scale + : + float | None = None +
+ )->[ + ist[int] + NodeVisit + ] +
+
+ +
+ + + +
+ +## dijkstra_tree_segment + + +
+dijkstra_tree_segment
+ ( +
+ self +
+
+ src_idx + : + int +
+
+ max_dist + : + int
jitter_scale @@ -2726,22 +2795,22 @@ datapoints are not located with high spatial precision. -node_xs: list[float] +node_xys: list[tuple[float, float]] -node_xys: list[tuple[float, float]] +node_ys: list[float] -node_lives: list[bool] +node_xs: list[float] -node_ys: list[float] +node_lives: list[bool] diff --git a/docs/src/pages/tools/graphs.md b/docs/src/pages/tools/graphs.md index 2d9e981e..d2a7165d 100644 --- a/docs/src/pages/tools/graphs.md +++ b/docs/src/pages/tools/graphs.md @@ -712,7 +712,7 @@ primal. The same type of situation does not arise in the dual because the nodes
- A dual representation `networkX` graph. The new dual nodes will have `x` and `y` node attributes corresponding to the mid-points of the original primal edges. If `live` node attributes were provided, then the `live` attribute for the new dual nodes will be set to `True` if either or both of the adjacent primal nodes were set to `live=True`. Otherwise, all dual nodes wil be set to `live=True`. The primal `geom` edge attributes will be split and welded to form the new dual `geom` edge attributes. `primal_edge_node_a`, `primal_edge_node_b`, and `primal_edge_idx` attributes will be added to the new (dual) nodes, and a `primal_node_id` edge attribute will be added to the new (dual) edges. This is useful for welding the primal geometry to the dual representations where useful for purposes such as visualisation, or otherwise welding downstream metrics to source (primal) geometries.
+ A dual representation `networkX` graph. The new dual nodes will have `x` and `y` node attributes corresponding to the mid-points of the original primal edges. If `live` node attributes were provided, then the `live` attribute for the new dual nodes will be set to `True` if either or both of the adjacent primal nodes were set to `live=True`. Otherwise, all dual nodes wil be set to `live=True`. The primal edges will be split and welded to form the new dual `geom` edges. The primal `LineString` `geom` will be saved to the dual node's `primal_edge` attribute. `primal_edge_node_a`, `primal_edge_node_b`, and `primal_edge_idx` attributes will be added to the new (dual) nodes, and a `primal_node_id` edge attribute will be added to the new (dual) edges.
### Notes diff --git a/docs/src/pages/tools/io.md b/docs/src/pages/tools/io.md index 2f92094b..667e35a2 100644 --- a/docs/src/pages/tools/io.md +++ b/docs/src/pages/tools/io.md @@ -853,7 +853,7 @@ out qt;
- A `gpd.GeoDataFrame` with `live`, `weight`, and `geometry` attributes. The original `networkX` graph's node keys will be used for the `GeoDataFrame` index.
+ A `gpd.GeoDataFrame` with `live`, `weight`, and `geometry` attributes. The original `networkX` graph's node keys will be used for the `GeoDataFrame` index. If `nx_multigraph` is a dual graph prepared with [`graphs.nx_to_dual`](/tools/graphs#nx-to-dual) then the corresponding primal edge `LineString` geometry will be set as the `GeoPandas` geometry for visualisation purposes using `primal_edge` for the column name. The dual node `Point` geometry will be saved in `WKT` format to the `dual_node` column.
@@ -880,6 +880,68 @@ out qt;
+
+ +## network_structure_from_gpd + + +
+network_structure_from_gpd
+ ( +
+ nodes_gdf + : + geopandas.geodataframe.GeoDataFrame +
+
+ edges_gdf + : + geopandas.geodataframe.GeoDataFrame +
+ )->[ + NetworkStructure + ] +
+
+ + + Reassembles a `NetworkStructure` from cityseer nodes and edges GeoDataFrames. This method is intended for use with "circular" workflows, where a `cityseer` NetworkX graph has been converted into `cityseer` nodes and edges GeoDataFrames using [`network_structure_from_nx`](#network_structure_from_nx). If the resultant GeoDataFrames are saved to disk and reloaded, then this method can be used to recreate the associated `NetworkStructure` which is required for optimised (`rust`) functions. +### Parameters +
+
+
nodes_gdf
+
gpd.GeoDataFrame
+
+
+ + A cityseer created nodes `gpd.GeoDataFrame` where the originating `networkX` graph's node keys have been saved as the DataFrame index, and where the columns contain `x`, `y`, `live`, and `weight` attributes.
+
+ +
+
+
edges_gdf
+
gpd.GeoDataFrame
+
+
+ + A cityseer created edges `gpd.GeoDataFrame` with `start_ns_node_idx`, `end_ns_node_idx`, `edge_idx`, `nx_start_node_key`, `nx_end_node_key`, `length`, `angle_sum`, `imp_factor`, `in_bearing`, `out_bearing` attributes.
+
+ +### Returns +
+
+
+
rustalgos.NetworkStructure
+
+
+ + A [`rustalgos.NetworkStructure`](/rustalgos/rustalgos#networkstructure) instance.
+
+ + +
+ +
## nx_from_cityseer_geopandas diff --git a/docs/src/pages/tools/plot.md b/docs/src/pages/tools/plot.md index 2687a7f2..217b04f6 100644 --- a/docs/src/pages/tools/plot.md +++ b/docs/src/pages/tools/plot.md @@ -1,23 +1,30 @@ --- layout: ../../layouts/PageLayout.astro --- -
# plot -Convenience methods for plotting graphs within the cityseer API context. Custom behaviour can be achieved by directly manipulating the underlying [`NetworkX`](https://networkx.github.io) and [`matplotlib`](https://matplotlib.org) figures. This module is predominately used for basic plots or visual verification of behaviour in code tests. Users are encouraged to use matplotlib or other plotting packages directly where possible. + + Convenience methods for plotting graphs within the cityseer API context. Custom behaviour can be achieved by directly manipulating the underlying [`NetworkX`](https://networkx.github.io) and [`matplotlib`](https://matplotlib.org) figures. This module is predominately used for basic plots or visual verification of behaviour in code tests. Users are encouraged to use matplotlib or other plotting packages directly where possible. +
+ ## ColourMap -Specifies global colour presets. + + + Specifies global colour presets. + +
## ColourMap +
ColourMap
( @@ -27,12 +34,15 @@ Specifies global colour presets.
+
+
## plot_nx_primal_or_dual +
plot_nx_primal_or_dual
( @@ -111,10 +121,9 @@ Specifies global colour presets.
-Plot a primal or dual cityseer graph. + Plot a primal or dual cityseer graph. ### Parameters -
primal_graph
@@ -122,8 +131,7 @@ Plot a primal or dual cityseer graph.
-An optional `NetworkX` MultiGraph to plot in the primal representation. Defaults to None.
- + An optional `NetworkX` MultiGraph to plot in the primal representation. Defaults to None.
@@ -133,8 +141,7 @@ An optional `NetworkX` MultiGraph to plot in the primal representation. Defaults
-An optional `NetworkX` MultiGraph to plot in the dual representation. Defaults to None.
- + An optional `NetworkX` MultiGraph to plot in the dual representation. Defaults to None.
@@ -144,8 +151,7 @@ An optional `NetworkX` MultiGraph to plot in the dual representation. Defaults t
-An optional filepath: if provided, the image will be saved to the path instead of being displayed. Defaults to None.
- + An optional filepath: if provided, the image will be saved to the path instead of being displayed. Defaults to None.
@@ -155,8 +161,7 @@ An optional filepath: if provided, the image will be saved to the path instead o
-Whether to display node labels. Defaults to False.
- + Whether to display node labels. Defaults to False.
@@ -166,8 +171,7 @@ Whether to display node labels. Defaults to False.
-The diameter for the primal graph's nodes.
- + The diameter for the primal graph's nodes.
@@ -177,8 +181,7 @@ The diameter for the primal graph's nodes.
-Primal node colour or colours. When passing an iterable of colours, the number of colours should match the order and number of nodes in the MultiGraph. The colours are passed to the underlying [`draw_networkx`](https://networkx.github.io/documentation/networkx-1.10/reference/generated/networkx.drawing.nx_pylab.draw_networkx.html#draw-networkx) # pylint: disable=line-too-long method and should be formatted accordingly. Defaults to None.
- + Primal node colour or colours. When passing an iterable of colours, the number of colours should match the order and number of nodes in the MultiGraph. The colours are passed to the underlying [`draw_networkx`](https://networkx.github.io/documentation/networkx-1.10/reference/generated/networkx.drawing.nx_pylab.draw_networkx.html#draw-networkx) # pylint: disable=line-too-long method and should be formatted accordingly. Defaults to None.
@@ -188,8 +191,7 @@ Primal node colour or colours. When passing an iterable of colours, the number o
-Primal edge colour or colours. When passing an iterable of colours, the number of colours should match the order and number of edges in the MultiGraph. The colours are passed to the underlying [`draw_networkx`](https://networkx.github.io/documentation/networkx-1.10/reference/generated/networkx.drawing.nx_pylab.draw_networkx.html#draw-networkx) # pylint: disable=line-too-long method and should be formatted accordingly. Defaults to None.
- + Primal edge colour or colours. When passing an iterable of colours, the number of colours should match the order and number of edges in the MultiGraph. The colours are passed to the underlying [`draw_networkx`](https://networkx.github.io/documentation/networkx-1.10/reference/generated/networkx.drawing.nx_pylab.draw_networkx.html#draw-networkx) # pylint: disable=line-too-long method and should be formatted accordingly. Defaults to None.
@@ -199,8 +201,7 @@ Primal edge colour or colours. When passing an iterable of colours, the number o
-The diameter for the dual graph's nodes.
- + The diameter for the dual graph's nodes.
@@ -210,8 +211,7 @@ The diameter for the dual graph's nodes.
-Dual node colour or colours. When passing a list of colours, the number of colours should match the order and number of nodes in the MultiGraph. The colours are passed to the underlying [`draw_networkx`](https://networkx.github.io/documentation/networkx-1.10/reference/generated/networkx.drawing.nx_pylab.draw_networkx.html#draw-networkx) # pylint: disable=line-too-long method and should be formatted accordingly. Defaults to None.
- + Dual node colour or colours. When passing a list of colours, the number of colours should match the order and number of nodes in the MultiGraph. The colours are passed to the underlying [`draw_networkx`](https://networkx.github.io/documentation/networkx-1.10/reference/generated/networkx.drawing.nx_pylab.draw_networkx.html#draw-networkx) # pylint: disable=line-too-long method and should be formatted accordingly. Defaults to None.
@@ -221,8 +221,7 @@ Dual node colour or colours. When passing a list of colours, the number of colou
-Dual edge colour or colours. When passing an iterable of colours, the number of colours should match the order and number of edges in the MultiGraph. The colours are passed to the underlying [`draw_networkx`](https://networkx.github.io/documentation/networkx-1.10/reference/generated/networkx.drawing.nx_pylab.draw_networkx.html#draw-networkx) # pylint: disable=line-too-long method and should be formatted accordingly. Defaults to None.
- + Dual edge colour or colours. When passing an iterable of colours, the number of colours should match the order and number of edges in the MultiGraph. The colours are passed to the underlying [`draw_networkx`](https://networkx.github.io/documentation/networkx-1.10/reference/generated/networkx.drawing.nx_pylab.draw_networkx.html#draw-networkx) # pylint: disable=line-too-long method and should be formatted accordingly. Defaults to None.
@@ -232,8 +231,7 @@ Dual edge colour or colours. When passing an iterable of colours, the number of
-Linewidths for the primal edge. Defaults to None.
- + Linewidths for the primal edge. Defaults to None.
@@ -243,8 +241,7 @@ Linewidths for the primal edge. Defaults to None.
-Linewidths for the dual edge. Defaults to None.
- + Linewidths for the dual edge. Defaults to None.
@@ -254,8 +251,7 @@ Linewidths for the dual edge. Defaults to None.
-Whether to plot the edge geometries. If set to `False`, straight lines will be drawn from node-to-node to represent edges. Defaults to True.
- + Whether to plot the edge geometries. If set to `False`, straight lines will be drawn from node-to-node to represent edges. Defaults to True.
@@ -265,8 +261,7 @@ Whether to plot the edge geometries. If set to `False`, straight lines will be d
-A tuple or list with the minimum and maxium `x` extents to be plotted. Defaults to None.
- + A tuple or list with the minimum and maxium `x` extents to be plotted. Defaults to None.
@@ -276,8 +271,7 @@ A tuple or list with the minimum and maxium `x` extents to be plotted. Defaults
-A tuple or list with the minimum and maxium `y` extents to be plotted. Defaults to None.
- + A tuple or list with the minimum and maxium `y` extents to be plotted. Defaults to None.
@@ -287,8 +281,7 @@ A tuple or list with the minimum and maxium `y` extents to be plotted. Defaults
-An optional `matplotlib` `ax` to which to plot. If not provided, a figure and ax will be generated.
- + An optional `matplotlib` `ax` to which to plot. If not provided, a figure and ax will be generated.
@@ -298,13 +291,12 @@ An optional `matplotlib` `ax` to which to plot. If not provided, a figure and ax
-`kwargs` which will be passed to the `matplotlib` figure parameters. If provided, these will override the default figure size or dpi parameters.
- + `kwargs` which will be passed to the `matplotlib` figure parameters. If provided, these will override the default figure size or dpi parameters. ### Notes -Plot either or both primal and dual representations of a `networkX MultiGraph`. Only call this function directly if explicitly printing both primal and dual graphs. Otherwise, use the simplified [`plot_nx`](/tools/plot#plot-nx) method instead. + Plot either or both primal and dual representations of a `networkX MultiGraph`. Only call this function directly if explicitly printing both primal and dual graphs. Otherwise, use the simplified [`plot_nx`](/tools/plot#plot-nx) method instead. ```py from cityseer.tools import mock, graphs, plot @@ -320,10 +312,12 @@ plot.plot_nx_primal_or_dual(G_simple, +
## plot_nx +
plot_nx
( @@ -383,10 +377,9 @@ plot.plot_nx_primal_or_dual(G_simple,
-Plot a `networkX` MultiGraph. + Plot a `networkX` MultiGraph. ### Parameters -
nx_multigraph
@@ -394,8 +387,7 @@ Plot a `networkX` MultiGraph.
-A `NetworkX` MultiGraph.
- + A `NetworkX` MultiGraph.
@@ -405,8 +397,7 @@ A `NetworkX` MultiGraph.
-An optional filepath: if provided, the image will be saved to the path instead of being displayed. Defaults to None.
- + An optional filepath: if provided, the image will be saved to the path instead of being displayed. Defaults to None.
@@ -416,8 +407,7 @@ An optional filepath: if provided, the image will be saved to the path instead o
-Whether to display node labels. Defaults to False.
- + Whether to display node labels. Defaults to False.
@@ -427,8 +417,7 @@ Whether to display node labels. Defaults to False.
-The diameter for the graph's nodes.
- + The diameter for the graph's nodes.
@@ -438,8 +427,7 @@ The diameter for the graph's nodes.
-Node colour or colours. When passing an iterable of colours, the number of colours should match the order and number of nodes in the MultiGraph. The colours are passed to the underlying [`draw_networkx`](https://networkx.github.io/documentation/networkx-1.10/reference/generated/networkx.drawing.nx_pylab.draw_networkx.html#draw-networkx) # pylint: disable=line-too-long method and should be formatted accordingly. Defaults to None.
- + Node colour or colours. When passing an iterable of colours, the number of colours should match the order and number of nodes in the MultiGraph. The colours are passed to the underlying [`draw_networkx`](https://networkx.github.io/documentation/networkx-1.10/reference/generated/networkx.drawing.nx_pylab.draw_networkx.html#draw-networkx) # pylint: disable=line-too-long method and should be formatted accordingly. Defaults to None.
@@ -449,8 +437,7 @@ Node colour or colours. When passing an iterable of colours, the number of colou
-Edges colour as a `matplotlib` compatible colour string. Defaults to None.
- + Edges colour as a `matplotlib` compatible colour string. Defaults to None.
@@ -460,8 +447,7 @@ Edges colour as a `matplotlib` compatible colour string. Defaults to None.
-Linewidths for edges. Defaults to None.
- + Linewidths for edges. Defaults to None.
@@ -471,8 +457,7 @@ Linewidths for edges. Defaults to None.
-Whether to plot the edge geometries. If set to `False`, straight lines will be drawn from node-to-node to represent edges. Defaults to True.
- + Whether to plot the edge geometries. If set to `False`, straight lines will be drawn from node-to-node to represent edges. Defaults to True.
@@ -482,8 +467,7 @@ Whether to plot the edge geometries. If set to `False`, straight lines will be d
-A tuple or list with the minimum and maximum `x` extents to be plotted. Defaults to None.
- + A tuple or list with the minimum and maximum `x` extents to be plotted. Defaults to None.
@@ -493,8 +477,7 @@ A tuple or list with the minimum and maximum `x` extents to be plotted. Defaults
-A tuple or list with the minimum and maximum `y` extents to be plotted. Defaults to None.
- + A tuple or list with the minimum and maximum `y` extents to be plotted. Defaults to None.
@@ -504,8 +487,7 @@ A tuple or list with the minimum and maximum `y` extents to be plotted. Defaults
-An optional `matplotlib` `ax` to which to plot. If not provided, a figure and ax will be generated.
- + An optional `matplotlib` `ax` to which to plot. If not provided, a figure and ax will be generated.
@@ -515,14 +497,13 @@ An optional `matplotlib` `ax` to which to plot. If not provided, a figure and ax
-`kwargs` which will be passed to the `matplotlib` figure parameters. If provided, these will override the default figure size or dpi parameters.
- + `kwargs` which will be passed to the `matplotlib` figure parameters. If provided, these will override the default figure size or dpi parameters. ### Notes ```py -from cityseer.tools import mock, graphs, plot +from cityseer.tools import mock, graphs, plot, io from cityseer.metrics import networks from matplotlib import colors @@ -530,15 +511,17 @@ from matplotlib import colors G = mock.mock_graph() G = graphs.nx_simple_geoms(G) G = graphs.nx_decompose(G, 50) -nodes_gdf, network_structure = io.network_structure_from_nx(G, crs=3395) -networks.node_centrality( - measures=["node_beta"], network_structure=network_structure, nodes_gdf=nodes_gdf, distances=[800] +nodes_gdf, edges_gdf, network_structure = io.network_structure_from_nx(G, crs=3395) +networks.node_centrality_shortest( + network_structure=network_structure, + nodes_gdf=nodes_gdf, + distances=[800] ) -G_after = graphs.nx_from_network_structure(nodes_gdf, network_structure, G) +G_after = io.nx_from_cityseer_geopandas(nodes_gdf, edges_gdf) # let's extract and normalise the values vals = [] for node, data in G_after.nodes(data=True): - vals.append(data["cc_node_beta_800"]) + vals.append(data["cc_beta_800"]) # let's create a custom colourmap using matplotlib cmap = colors.LinearSegmentedColormap.from_list( "cityseer", [(100 / 255, 193 / 255, 255 / 255, 255 / 255), (211 / 255, 47 / 255, 47 / 255, 1 / 255)] @@ -551,14 +534,17 @@ cols = cmap(vals) plot.plot_nx(G_after, node_colour=cols) ``` + ![Example Colour Plot.](/images/graph_colour.png) _Colour plot of 800m gravity index centrality on a 50m decomposed graph._ +
## plot_assignment +
plot_assignment
( @@ -598,13 +584,12 @@ plot.plot_nx(G_after, node_colour=cols)
-Plot a `network_structure` and `data_gdf` for visualising assignment of data points to respective nodes. + + Plot a `network_structure` and `data_gdf` for visualising assignment of data points to respective nodes. :::warning This method is primarily intended for package testing and development. ::: - ### Parameters -
network_structure
@@ -612,8 +597,7 @@ This method is primarily intended for package testing and development.
-A [`rustalgos.NetworkStructure`](/rustalgos/rustalgos#networkstructure) instance.
- + A [`rustalgos.NetworkStructure`](/rustalgos/rustalgos#networkstructure) instance.
@@ -623,8 +607,7 @@ A [`rustalgos.NetworkStructure`](/rustalgos/rustalgos#networkstructure) instance
-A `NetworkX` MultiGraph.
- + A `NetworkX` MultiGraph.
@@ -634,8 +617,7 @@ A `NetworkX` MultiGraph.
-A `data_gdf` `GeoDataFrame` with `nearest_assigned` and `next_neareset_assign` columns.
- + A `data_gdf` `GeoDataFrame` with `nearest_assigned` and `next_neareset_assign` columns.
@@ -645,8 +627,7 @@ A `data_gdf` `GeoDataFrame` with `nearest_assigned` and `next_neareset_assign` c
-An optional filepath: if provided, the image will be saved to the path instead of being displayed. Defaults to None.
- + An optional filepath: if provided, the image will be saved to the path instead of being displayed. Defaults to None.
@@ -656,8 +637,7 @@ An optional filepath: if provided, the image will be saved to the path instead o
-Node colour or colours. When passing a list of colours, the number of colours should match the order and number of nodes in the MultiGraph. The colours are passed to the underlying [`draw_networkx`](https://networkx.github.io/documentation/networkx-1.10/reference/generated/networkx.drawing.nx_pylab.draw_networkx.html#draw-networkx) # pylint: disable=line-too-long method and should be formatted accordingly. Defaults to None.
- + Node colour or colours. When passing a list of colours, the number of colours should match the order and number of nodes in the MultiGraph. The colours are passed to the underlying [`draw_networkx`](https://networkx.github.io/documentation/networkx-1.10/reference/generated/networkx.drawing.nx_pylab.draw_networkx.html#draw-networkx) # pylint: disable=line-too-long method and should be formatted accordingly. Defaults to None.
@@ -667,8 +647,7 @@ Node colour or colours. When passing a list of colours, the number of colours sh
-Whether to plot the node labels. Defaults to False.
- + Whether to plot the node labels. Defaults to False.
@@ -678,8 +657,7 @@ Whether to plot the node labels. Defaults to False.
-An optional iterable of categorical data labels which will be mapped to colours. The number of labels should match the number of data points in `data_layer`. Defaults to None.
- + An optional iterable of categorical data labels which will be mapped to colours. The number of labels should match the number of data points in `data_layer`. Defaults to None.
@@ -689,8 +667,7 @@ An optional iterable of categorical data labels which will be mapped to colours.
-`kwargs` which will be passed to the `matplotlib` figure parameters. If provided, these will override the default figure size or dpi parameters.
- + `kwargs` which will be passed to the `matplotlib` figure parameters. If provided, these will override the default figure size or dpi parameters. ### Notes @@ -699,10 +676,12 @@ An optional iterable of categorical data labels which will be mapped to colours. +
## plot_network_structure +
plot_network_structure
( @@ -725,14 +704,13 @@ An optional iterable of categorical data labels which will be mapped to colours.
-Plot a graph from raw `cityseer` network structure. + + Plot a graph from raw `cityseer` network structure. :::note Note that this function is subject to frequent revision pending short-term development requirements. It is used mainly to visually confirm the correct behaviour of particular algorithms during the software development cycle. ::: - ### Parameters -
network_structure
@@ -740,8 +718,7 @@ mainly to visually confirm the correct behaviour of particular algorithms during
-A [`rustalgos.NetworkStructure`](/rustalgos/rustalgos#networkstructure) instance.
- + A [`rustalgos.NetworkStructure`](/rustalgos/rustalgos#networkstructure) instance.
@@ -751,8 +728,7 @@ A [`rustalgos.NetworkStructure`](/rustalgos/rustalgos#networkstructure) instance
-A `data_gdf` `GeoDataFrame` with `nearest_assigned` and `next_neareset_assign` columns.
- + A `data_gdf` `GeoDataFrame` with `nearest_assigned` and `next_neareset_assign` columns.
@@ -762,16 +738,18 @@ A `data_gdf` `GeoDataFrame` with `nearest_assigned` and `next_neareset_assign` c
-An optional polygon. Defaults to None.
- + An optional polygon. Defaults to None. + +
## plot_scatter +
plot_scatter
( @@ -833,10 +811,9 @@ An optional polygon. Defaults to None.
-Convenience plotting function for plotting outputs from examples in demo notebooks. + Convenience plotting function for plotting outputs from examples in the Cityseer Guide. ### Parameters -
ax
@@ -844,8 +821,7 @@ Convenience plotting function for plotting outputs from examples in demo noteboo
-A 'matplotlib' `Ax` to which to plot.
- + A 'matplotlib' `Ax` to which to plot.
@@ -855,8 +831,7 @@ A 'matplotlib' `Ax` to which to plot.
-A numpy array of floats representing the `x` coordinates for points to plot.
- + A numpy array of floats representing the `x` coordinates for points to plot.
@@ -866,8 +841,7 @@ A numpy array of floats representing the `x` coordinates for points to plot.
-A numpy array of floats representing the `y` coordinates for points to plot.
- + A numpy array of floats representing the `y` coordinates for points to plot.
@@ -877,8 +851,7 @@ A numpy array of floats representing the `y` coordinates for points to plot.
-A numpy array of floats representing the data values for the provided points.
- + A numpy array of floats representing the data values for the provided points.
@@ -888,8 +861,7 @@ A numpy array of floats representing the data values for the provided points.
-A tuple or list containing the `[s, w, n, e]` bounding box extents for clipping the plot.
- + A tuple or list containing the `[s, w, n, e]` bounding box extents for clipping the plot.
@@ -899,8 +871,7 @@ A tuple or list containing the `[s, w, n, e]` bounding box extents for clipping
-A tuple of two floats, representing the minimum and maximum percentiles at which to clip the data.
- + A tuple of two floats, representing the minimum and maximum percentiles at which to clip the data.
@@ -910,8 +881,7 @@ A tuple of two floats, representing the minimum and maximum percentiles at which
-A `matplotlib` colour map key.
- + A `matplotlib` colour map key.
@@ -921,8 +891,7 @@ A `matplotlib` colour map key.
-A float representing an exponential for reshaping the values distribution. Defaults to 1 which returns the values as provided. An exponential greater than or less than 1 will shape the values distribution accordingly.
- + A float representing an exponential for reshaping the values distribution. Defaults to 1 which returns the values as provided. An exponential greater than or less than 1 will shape the values distribution accordingly.
@@ -932,8 +901,7 @@ A float representing an exponential for reshaping the values distribution. Defau
-A float representing the minimum size for a plotted point.
- + A float representing the minimum size for a plotted point.
@@ -943,8 +911,7 @@ A float representing the minimum size for a plotted point.
-A float representing the maximum size for a plotted point.
- + A float representing the maximum size for a plotted point.
@@ -954,8 +921,7 @@ A float representing the maximum size for a plotted point.
-Whether or not to rasterise the output. Recommended for plots with a large number of points.
- + Whether or not to rasterise the output. Recommended for plots with a large number of points.
@@ -965,16 +931,18 @@ Whether or not to rasterise the output. Recommended for plots with a large numbe
-A hex or other valid `matplotlib` colour value for the ax and figure faces (backgrounds).
- + A hex or other valid `matplotlib` colour value for the ax and figure faces (backgrounds). + +
## plot_nx_edges +
plot_nx_edges
( @@ -1057,10 +1025,9 @@ A hex or other valid `matplotlib` colour value for the ax and figure faces (back
-Convenience plotting function for plotting edge outputs from examples in demo notebooks. + Convenience plotting function for plotting outputs from examples in the Cityseer Guide. ### Parameters -
ax
@@ -1068,8 +1035,7 @@ Convenience plotting function for plotting edge outputs from examples in demo no
-A 'matplotlib' `Ax` to which to plot.
- + A 'matplotlib' `Ax` to which to plot.
@@ -1079,8 +1045,7 @@ A 'matplotlib' `Ax` to which to plot.
-A `NetworkX` MultiGraph.
- + A `NetworkX` MultiGraph.
@@ -1090,8 +1055,7 @@ A `NetworkX` MultiGraph.
-An edge key for the provided `nx_multigraph`. Plotted values will be retrieved from this edge key.
- + An edge key for the provided `nx_multigraph`. Plotted values will be retrieved from this edge key.
@@ -1101,8 +1065,7 @@ An edge key for the provided `nx_multigraph`. Plotted values will be retrieved f
-A tuple or list containing the `[s, w, n, e]` bounding box extents for clipping the plot.
- + A tuple or list containing the `[s, w, n, e]` bounding box extents for clipping the plot.
@@ -1112,8 +1075,7 @@ A tuple or list containing the `[s, w, n, e]` bounding box extents for clipping
-A tuple of two floats, representing the minimum and maximum percentiles at which to clip the data.
- + A tuple of two floats, representing the minimum and maximum percentiles at which to clip the data.
@@ -1123,8 +1085,7 @@ A tuple of two floats, representing the minimum and maximum percentiles at which
-A `matplotlib` colour map key.
- + A `matplotlib` colour map key.
@@ -1134,8 +1095,7 @@ A `matplotlib` colour map key.
-A float representing an exponential for reshaping the values distribution. Defaults to 1 which returns the values as provided. An exponential greater than or less than 1 will shape the values distribution accordingly.
- + A float representing an exponential for reshaping the values distribution. Defaults to 1 which returns the values as provided. An exponential greater than or less than 1 will shape the values distribution accordingly.
@@ -1145,8 +1105,7 @@ A float representing an exponential for reshaping the values distribution. Defau
-A float representing the minimum line width for a plotted edge.
- + A float representing the minimum line width for a plotted edge.
@@ -1156,8 +1115,7 @@ A float representing the minimum line width for a plotted edge.
-A float representing the maximum line width for a plotted edge.
- + A float representing the maximum line width for a plotted edge.
@@ -1167,8 +1125,7 @@ A float representing the maximum line width for a plotted edge.
-A key for retrieving categorical labels from edges.
- + A key for retrieving categorical labels from edges.
@@ -1178,8 +1135,7 @@ A key for retrieving categorical labels from edges.
-Whether to plot colours by categorical. This requires an `edge_label_key` parameter.
- + Whether to plot colours by categorical. This requires an `edge_label_key` parameter.
@@ -1189,8 +1145,7 @@ Whether to plot colours by categorical. This requires an `edge_label_key` parame
-The number of categorical values (sorted in decreasing order) to plot.
- + The number of categorical values (sorted in decreasing order) to plot.
@@ -1200,8 +1155,7 @@ The number of categorical values (sorted in decreasing order) to plot.
-Whether or not to rasterise the output. Recommended for plots with a large number of edges.
- + Whether or not to rasterise the output. Recommended for plots with a large number of edges.
@@ -1211,8 +1165,7 @@ Whether or not to rasterise the output. Recommended for plots with a large numbe
-A hex or other valid `matplotlib` colour value for the ax and figure faces (backgrounds).
- + A hex or other valid `matplotlib` colour value for the ax and figure faces (backgrounds).
@@ -1222,10 +1175,12 @@ A hex or other valid `matplotlib` colour value for the ax and figure faces (back
-Whether to invert the plot order, e.g. if using an inverse colour map.
- + Whether to invert the plot order, e.g. if using an inverse colour map. + + + diff --git a/pdm.lock b/pdm.lock index b84bda6c..df799613 100644 --- a/pdm.lock +++ b/pdm.lock @@ -5,7 +5,7 @@ groups = ["default", "dev"] strategy = ["cross_platform", "inherit_metadata"] lock_version = "4.4.1" -content_hash = "sha256:019a5021b7cad09c06f1c87b8ff2e7e4ae06435b79e8924ce01490421389f053" +content_hash = "sha256:9cd8f5217f9f67fd5c6c02b678acb5f3b096d3d1035138003b7ff130c4f62d6c" [[package]] name = "affine" @@ -187,7 +187,7 @@ files = [ [[package]] name = "black" -version = "24.3.0" +version = "24.4.0" requires_python = ">=3.8" summary = "The uncompromising code formatter." groups = ["dev"] @@ -201,20 +201,20 @@ dependencies = [ "typing-extensions>=4.0.1; python_version < \"3.11\"", ] files = [ - {file = "black-24.3.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:7d5e026f8da0322b5662fa7a8e752b3fa2dac1c1cbc213c3d7ff9bdd0ab12395"}, - {file = "black-24.3.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:9f50ea1132e2189d8dff0115ab75b65590a3e97de1e143795adb4ce317934995"}, - {file = "black-24.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e2af80566f43c85f5797365077fb64a393861a3730bd110971ab7a0c94e873e7"}, - {file = "black-24.3.0-cp310-cp310-win_amd64.whl", hash = "sha256:4be5bb28e090456adfc1255e03967fb67ca846a03be7aadf6249096100ee32d0"}, - {file = "black-24.3.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:4f1373a7808a8f135b774039f61d59e4be7eb56b2513d3d2f02a8b9365b8a8a9"}, - {file = "black-24.3.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:aadf7a02d947936ee418777e0247ea114f78aff0d0959461057cae8a04f20597"}, - {file = "black-24.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:65c02e4ea2ae09d16314d30912a58ada9a5c4fdfedf9512d23326128ac08ac3d"}, - {file = "black-24.3.0-cp311-cp311-win_amd64.whl", hash = "sha256:bf21b7b230718a5f08bd32d5e4f1db7fc8788345c8aea1d155fc17852b3410f5"}, - {file = "black-24.3.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:2818cf72dfd5d289e48f37ccfa08b460bf469e67fb7c4abb07edc2e9f16fb63f"}, - {file = "black-24.3.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:4acf672def7eb1725f41f38bf6bf425c8237248bb0804faa3965c036f7672d11"}, - {file = "black-24.3.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c7ed6668cbbfcd231fa0dc1b137d3e40c04c7f786e626b405c62bcd5db5857e4"}, - {file = "black-24.3.0-cp312-cp312-win_amd64.whl", hash = "sha256:56f52cfbd3dabe2798d76dbdd299faa046a901041faf2cf33288bc4e6dae57b5"}, - {file = "black-24.3.0-py3-none-any.whl", hash = "sha256:41622020d7120e01d377f74249e677039d20e6344ff5851de8a10f11f513bf93"}, - {file = "black-24.3.0.tar.gz", hash = "sha256:a0c9c4a0771afc6919578cec71ce82a3e31e054904e7197deacbc9382671c41f"}, + {file = "black-24.4.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:6ad001a9ddd9b8dfd1b434d566be39b1cd502802c8d38bbb1ba612afda2ef436"}, + {file = "black-24.4.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:e3a3a092b8b756c643fe45f4624dbd5a389f770a4ac294cf4d0fce6af86addaf"}, + {file = "black-24.4.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dae79397f367ac8d7adb6c779813328f6d690943f64b32983e896bcccd18cbad"}, + {file = "black-24.4.0-cp310-cp310-win_amd64.whl", hash = "sha256:71d998b73c957444fb7c52096c3843875f4b6b47a54972598741fe9a7f737fcb"}, + {file = "black-24.4.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:8e5537f456a22cf5cfcb2707803431d2feeb82ab3748ade280d6ccd0b40ed2e8"}, + {file = "black-24.4.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:64e60a7edd71fd542a10a9643bf369bfd2644de95ec71e86790b063aa02ff745"}, + {file = "black-24.4.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5cd5b4f76056cecce3e69b0d4c228326d2595f506797f40b9233424e2524c070"}, + {file = "black-24.4.0-cp311-cp311-win_amd64.whl", hash = "sha256:64578cf99b6b46a6301bc28bdb89f9d6f9b592b1c5837818a177c98525dbe397"}, + {file = "black-24.4.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:f95cece33329dc4aa3b0e1a771c41075812e46cf3d6e3f1dfe3d91ff09826ed2"}, + {file = "black-24.4.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:4396ca365a4310beef84d446ca5016f671b10f07abdba3e4e4304218d2c71d33"}, + {file = "black-24.4.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:44d99dfdf37a2a00a6f7a8dcbd19edf361d056ee51093b2445de7ca09adac965"}, + {file = "black-24.4.0-cp312-cp312-win_amd64.whl", hash = "sha256:21f9407063ec71c5580b8ad975653c66508d6a9f57bd008bb8691d273705adcd"}, + {file = "black-24.4.0-py3-none-any.whl", hash = "sha256:74eb9b5420e26b42c00a3ff470dc0cd144b80a766128b1771d07643165e08d0e"}, + {file = "black-24.4.0.tar.gz", hash = "sha256:f07b69fda20578367eaebbd670ff8fc653ab181e1ff95d84497f9fa20e7d0641"}, ] [[package]] @@ -1168,14 +1168,14 @@ files = [ [[package]] name = "jupyterlab" -version = "4.1.5" +version = "4.1.6" requires_python = ">=3.8" summary = "JupyterLab computational environment" groups = ["dev"] dependencies = [ "async-lru>=1.0.0", "httpx>=0.25.0", - "ipykernel", + "ipykernel>=6.5.0", "jinja2>=3.0.3", "jupyter-core", "jupyter-lsp>=2.0.0", @@ -1183,13 +1183,13 @@ dependencies = [ "jupyterlab-server<3,>=2.19.0", "notebook-shim>=0.2", "packaging", - "tomli; python_version < \"3.11\"", + "tomli>=1.2.2; python_version < \"3.11\"", "tornado>=6.2.0", "traitlets", ] files = [ - {file = "jupyterlab-4.1.5-py3-none-any.whl", hash = "sha256:3bc843382a25e1ab7bc31d9e39295a9f0463626692b7995597709c0ab236ab2c"}, - {file = "jupyterlab-4.1.5.tar.gz", hash = "sha256:c9ad75290cb10bfaff3624bf3fbb852319b4cce4c456613f8ebbaa98d03524db"}, + {file = "jupyterlab-4.1.6-py3-none-any.whl", hash = "sha256:cf3e862bc10dbf4331e4eb37438634f813c238cfc62c71c640b3b3b2caa089a8"}, + {file = "jupyterlab-4.1.6.tar.gz", hash = "sha256:7935f36ba26eb615183a4f5c2bbca5791b5108ce2a00b5505f8cfd100d53648e"}, ] [[package]] @@ -1379,7 +1379,7 @@ files = [ [[package]] name = "matplotlib" -version = "3.8.3" +version = "3.8.4" requires_python = ">=3.9" summary = "Python plotting package" groups = ["default"] @@ -1388,35 +1388,35 @@ dependencies = [ "cycler>=0.10", "fonttools>=4.22.0", "kiwisolver>=1.3.1", - "numpy<2,>=1.21", + "numpy>=1.21", "packaging>=20.0", "pillow>=8", "pyparsing>=2.3.1", "python-dateutil>=2.7", ] files = [ - {file = "matplotlib-3.8.3-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:cf60138ccc8004f117ab2a2bad513cc4d122e55864b4fe7adf4db20ca68a078f"}, - {file = "matplotlib-3.8.3-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:5f557156f7116be3340cdeef7f128fa99b0d5d287d5f41a16e169819dcf22357"}, - {file = "matplotlib-3.8.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f386cf162b059809ecfac3bcc491a9ea17da69fa35c8ded8ad154cd4b933d5ec"}, - {file = "matplotlib-3.8.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b3c5f96f57b0369c288bf6f9b5274ba45787f7e0589a34d24bdbaf6d3344632f"}, - {file = "matplotlib-3.8.3-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:83e0f72e2c116ca7e571c57aa29b0fe697d4c6425c4e87c6e994159e0c008635"}, - {file = "matplotlib-3.8.3-cp310-cp310-win_amd64.whl", hash = "sha256:1c5c8290074ba31a41db1dc332dc2b62def469ff33766cbe325d32a3ee291aea"}, - {file = "matplotlib-3.8.3-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:5184e07c7e1d6d1481862ee361905b7059f7fe065fc837f7c3dc11eeb3f2f900"}, - {file = "matplotlib-3.8.3-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:d7e7e0993d0758933b1a241a432b42c2db22dfa37d4108342ab4afb9557cbe3e"}, - {file = "matplotlib-3.8.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:04b36ad07eac9740fc76c2aa16edf94e50b297d6eb4c081e3add863de4bb19a7"}, - {file = "matplotlib-3.8.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7c42dae72a62f14982f1474f7e5c9959fc4bc70c9de11cc5244c6e766200ba65"}, - {file = "matplotlib-3.8.3-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:bf5932eee0d428192c40b7eac1399d608f5d995f975cdb9d1e6b48539a5ad8d0"}, - {file = "matplotlib-3.8.3-cp311-cp311-win_amd64.whl", hash = "sha256:40321634e3a05ed02abf7c7b47a50be50b53ef3eaa3a573847431a545585b407"}, - {file = "matplotlib-3.8.3-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:09074f8057917d17ab52c242fdf4916f30e99959c1908958b1fc6032e2d0f6d4"}, - {file = "matplotlib-3.8.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:5745f6d0fb5acfabbb2790318db03809a253096e98c91b9a31969df28ee604aa"}, - {file = "matplotlib-3.8.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b97653d869a71721b639714b42d87cda4cfee0ee74b47c569e4874c7590c55c5"}, - {file = "matplotlib-3.8.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:242489efdb75b690c9c2e70bb5c6550727058c8a614e4c7716f363c27e10bba1"}, - {file = "matplotlib-3.8.3-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:83c0653c64b73926730bd9ea14aa0f50f202ba187c307a881673bad4985967b7"}, - {file = "matplotlib-3.8.3-cp312-cp312-win_amd64.whl", hash = "sha256:ef6c1025a570354297d6c15f7d0f296d95f88bd3850066b7f1e7b4f2f4c13a39"}, - {file = "matplotlib-3.8.3-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:fa93695d5c08544f4a0dfd0965f378e7afc410d8672816aff1e81be1f45dbf2e"}, - {file = "matplotlib-3.8.3-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e9764df0e8778f06414b9d281a75235c1e85071f64bb5d71564b97c1306a2afc"}, - {file = "matplotlib-3.8.3-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:5e431a09e6fab4012b01fc155db0ce6dccacdbabe8198197f523a4ef4805eb26"}, - {file = "matplotlib-3.8.3.tar.gz", hash = "sha256:7b416239e9ae38be54b028abbf9048aff5054a9aba5416bef0bd17f9162ce161"}, + {file = "matplotlib-3.8.4-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:abc9d838f93583650c35eca41cfcec65b2e7cb50fd486da6f0c49b5e1ed23014"}, + {file = "matplotlib-3.8.4-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:8f65c9f002d281a6e904976007b2d46a1ee2bcea3a68a8c12dda24709ddc9106"}, + {file = "matplotlib-3.8.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ce1edd9f5383b504dbc26eeea404ed0a00656c526638129028b758fd43fc5f10"}, + {file = "matplotlib-3.8.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ecd79298550cba13a43c340581a3ec9c707bd895a6a061a78fa2524660482fc0"}, + {file = "matplotlib-3.8.4-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:90df07db7b599fe7035d2f74ab7e438b656528c68ba6bb59b7dc46af39ee48ef"}, + {file = "matplotlib-3.8.4-cp310-cp310-win_amd64.whl", hash = "sha256:ac24233e8f2939ac4fd2919eed1e9c0871eac8057666070e94cbf0b33dd9c338"}, + {file = "matplotlib-3.8.4-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:72f9322712e4562e792b2961971891b9fbbb0e525011e09ea0d1f416c4645661"}, + {file = "matplotlib-3.8.4-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:232ce322bfd020a434caaffbd9a95333f7c2491e59cfc014041d95e38ab90d1c"}, + {file = "matplotlib-3.8.4-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6addbd5b488aedb7f9bc19f91cd87ea476206f45d7116fcfe3d31416702a82fa"}, + {file = "matplotlib-3.8.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:cc4ccdc64e3039fc303defd119658148f2349239871db72cd74e2eeaa9b80b71"}, + {file = "matplotlib-3.8.4-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:b7a2a253d3b36d90c8993b4620183b55665a429da8357a4f621e78cd48b2b30b"}, + {file = "matplotlib-3.8.4-cp311-cp311-win_amd64.whl", hash = "sha256:8080d5081a86e690d7688ffa542532e87f224c38a6ed71f8fbed34dd1d9fedae"}, + {file = "matplotlib-3.8.4-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:6485ac1f2e84676cff22e693eaa4fbed50ef5dc37173ce1f023daef4687df616"}, + {file = "matplotlib-3.8.4-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:c89ee9314ef48c72fe92ce55c4e95f2f39d70208f9f1d9db4e64079420d8d732"}, + {file = "matplotlib-3.8.4-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:50bac6e4d77e4262c4340d7a985c30912054745ec99756ce213bfbc3cb3808eb"}, + {file = "matplotlib-3.8.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f51c4c869d4b60d769f7b4406eec39596648d9d70246428745a681c327a8ad30"}, + {file = "matplotlib-3.8.4-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:b12ba985837e4899b762b81f5b2845bd1a28f4fdd1a126d9ace64e9c4eb2fb25"}, + {file = "matplotlib-3.8.4-cp312-cp312-win_amd64.whl", hash = "sha256:7a6769f58ce51791b4cb8b4d7642489df347697cd3e23d88266aaaee93b41d9a"}, + {file = "matplotlib-3.8.4-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:c7064120a59ce6f64103c9cefba8ffe6fba87f2c61d67c401186423c9a20fd35"}, + {file = "matplotlib-3.8.4-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a0e47eda4eb2614300fc7bb4657fced3e83d6334d03da2173b09e447418d499f"}, + {file = "matplotlib-3.8.4-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:493e9f6aa5819156b58fce42b296ea31969f2aab71c5b680b4ea7a3cb5c07d94"}, + {file = "matplotlib-3.8.4.tar.gz", hash = "sha256:8aac397d5e9ec158960e31c381c5ffc52ddd52bd9a47717e2a694038167dffea"}, ] [[package]] @@ -1586,13 +1586,13 @@ files = [ [[package]] name = "networkx" -version = "3.2.1" -requires_python = ">=3.9" +version = "3.3" +requires_python = ">=3.10" summary = "Python package for creating and manipulating graphs and networks" groups = ["default", "dev"] files = [ - {file = "networkx-3.2.1-py3-none-any.whl", hash = "sha256:f18c69adc97877c42332c170849c96cefa91881c99a7cb3e95b7c659ebdc1ec2"}, - {file = "networkx-3.2.1.tar.gz", hash = "sha256:9f1bb5cf3409bf324e0a722c20bdb4c20ee39bf1c30ce8ae499c8502b0b5e0c6"}, + {file = "networkx-3.3-py3-none-any.whl", hash = "sha256:28575580c6ebdaf4505b22c6256a2b9de86b316dc63ba9e93abde3d78dfdbcf2"}, + {file = "networkx-3.3.tar.gz", hash = "sha256:0c127d8b2f4865f59ae9cb8aafcd60b5c70f3241ebd66f7defad7c4ab90126c9"}, ] [[package]] @@ -1680,7 +1680,7 @@ files = [ [[package]] name = "osmnx" -version = "1.9.1" +version = "1.9.2" requires_python = ">=3.8" summary = "Download, model, analyze, and visualize street networks and other geospatial features from OpenStreetMap" groups = ["dev"] @@ -1693,8 +1693,8 @@ dependencies = [ "shapely>=2.0", ] files = [ - {file = "osmnx-1.9.1-py3-none-any.whl", hash = "sha256:804790b4963f915ca172f56ef27a9bd62347c44616902a1c8a12dc3d94737f4b"}, - {file = "osmnx-1.9.1.tar.gz", hash = "sha256:0c28e32755b27110b0dc140b74f7b66ba9d037f4a246dab8fb50d9383334e311"}, + {file = "osmnx-1.9.2-py3-none-any.whl", hash = "sha256:9ea17500b45aa8e4740490d649c7f7747fa4f2e3f9747294837fa2c80aabd05f"}, + {file = "osmnx-1.9.2.tar.gz", hash = "sha256:59d21756ebdb4a4d211fb1373a3dca170832eec5f25ef94f5500bd79d32c169a"}, ] [[package]] @@ -1987,6 +1987,40 @@ files = [ {file = "pure_eval-0.2.2.tar.gz", hash = "sha256:2b45320af6dfaa1750f543d714b6d1c520a1688dec6fd24d339063ce0aaa9ac3"}, ] +[[package]] +name = "pyarrow" +version = "16.0.0" +requires_python = ">=3.8" +summary = "Python library for Apache Arrow" +groups = ["default"] +dependencies = [ + "numpy>=1.16.6", +] +files = [ + {file = "pyarrow-16.0.0-cp310-cp310-macosx_10_15_x86_64.whl", hash = "sha256:22a1fdb1254e5095d629e29cd1ea98ed04b4bbfd8e42cc670a6b639ccc208b60"}, + {file = "pyarrow-16.0.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:574a00260a4ed9d118a14770edbd440b848fcae5a3024128be9d0274dbcaf858"}, + {file = "pyarrow-16.0.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c0815d0ddb733b8c1b53a05827a91f1b8bde6240f3b20bf9ba5d650eb9b89cdf"}, + {file = "pyarrow-16.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:df0080339387b5d30de31e0a149c0c11a827a10c82f0c67d9afae3981d1aabb7"}, + {file = "pyarrow-16.0.0-cp310-cp310-manylinux_2_28_aarch64.whl", hash = "sha256:edf38cce0bf0dcf726e074159c60516447e4474904c0033f018c1f33d7dac6c5"}, + {file = "pyarrow-16.0.0-cp310-cp310-manylinux_2_28_x86_64.whl", hash = "sha256:91d28f9a40f1264eab2af7905a4d95320ac2f287891e9c8b0035f264fe3c3a4b"}, + {file = "pyarrow-16.0.0-cp310-cp310-win_amd64.whl", hash = "sha256:99af421ee451a78884d7faea23816c429e263bd3618b22d38e7992c9ce2a7ad9"}, + {file = "pyarrow-16.0.0-cp311-cp311-macosx_10_15_x86_64.whl", hash = "sha256:d22d0941e6c7bafddf5f4c0662e46f2075850f1c044bf1a03150dd9e189427ce"}, + {file = "pyarrow-16.0.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:266ddb7e823f03733c15adc8b5078db2df6980f9aa93d6bb57ece615df4e0ba7"}, + {file = "pyarrow-16.0.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5cc23090224b6594f5a92d26ad47465af47c1d9c079dd4a0061ae39551889efe"}, + {file = "pyarrow-16.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:56850a0afe9ef37249d5387355449c0f94d12ff7994af88f16803a26d38f2016"}, + {file = "pyarrow-16.0.0-cp311-cp311-manylinux_2_28_aarch64.whl", hash = "sha256:705db70d3e2293c2f6f8e84874b5b775f690465798f66e94bb2c07bab0a6bb55"}, + {file = "pyarrow-16.0.0-cp311-cp311-manylinux_2_28_x86_64.whl", hash = "sha256:5448564754c154997bc09e95a44b81b9e31ae918a86c0fcb35c4aa4922756f55"}, + {file = "pyarrow-16.0.0-cp311-cp311-win_amd64.whl", hash = "sha256:729f7b262aa620c9df8b9967db96c1575e4cfc8c25d078a06968e527b8d6ec05"}, + {file = "pyarrow-16.0.0-cp312-cp312-macosx_10_15_x86_64.whl", hash = "sha256:fb8065dbc0d051bf2ae2453af0484d99a43135cadabacf0af588a3be81fbbb9b"}, + {file = "pyarrow-16.0.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:20ce707d9aa390593ea93218b19d0eadab56390311cb87aad32c9a869b0e958c"}, + {file = "pyarrow-16.0.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5823275c8addbbb50cd4e6a6839952682a33255b447277e37a6f518d6972f4e1"}, + {file = "pyarrow-16.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1ab8b9050752b16a8b53fcd9853bf07d8daf19093533e990085168f40c64d978"}, + {file = "pyarrow-16.0.0-cp312-cp312-manylinux_2_28_aarch64.whl", hash = "sha256:42e56557bc7c5c10d3e42c3b32f6cff649a29d637e8f4e8b311d334cc4326730"}, + {file = "pyarrow-16.0.0-cp312-cp312-manylinux_2_28_x86_64.whl", hash = "sha256:2a7abdee4a4a7cfa239e2e8d721224c4b34ffe69a0ca7981354fe03c1328789b"}, + {file = "pyarrow-16.0.0-cp312-cp312-win_amd64.whl", hash = "sha256:ef2f309b68396bcc5a354106741d333494d6a0d3e1951271849787109f0229a6"}, + {file = "pyarrow-16.0.0.tar.gz", hash = "sha256:59bb1f1edbbf4114c72415f039f1359f1a57d166a331c3229788ccbfbb31689a"}, +] + [[package]] name = "pycparser" version = "2.21" @@ -2092,7 +2126,7 @@ files = [ [[package]] name = "pyright" -version = "1.1.355" +version = "1.1.359" requires_python = ">=3.7" summary = "Command line wrapper for pyright" groups = ["dev"] @@ -2100,8 +2134,8 @@ dependencies = [ "nodeenv>=1.6.0", ] files = [ - {file = "pyright-1.1.355-py3-none-any.whl", hash = "sha256:bf30b6728fd68ae7d09c98292b67152858dd89738569836896df786e52b5fe48"}, - {file = "pyright-1.1.355.tar.gz", hash = "sha256:dca4104cd53d6484e6b1b50b7a239ad2d16d2ffd20030bcf3111b56f44c263bf"}, + {file = "pyright-1.1.359-py3-none-any.whl", hash = "sha256:5582777be7eab73512277ac7da7b41e15bc0737f488629cb9babd96e0769be61"}, + {file = "pyright-1.1.359.tar.gz", hash = "sha256:f0eab50f3dafce8a7302caeafd6a733f39901a2bf5170bb23d77fd607c8a8dbc"}, ] [[package]] @@ -2340,7 +2374,7 @@ files = [ [[package]] name = "rasterio" -version = "1.3.9" +version = "1.3.10" requires_python = ">=3.8" summary = "Fast and direct raster I/O for use with Numpy and SciPy" groups = ["default"] @@ -2356,19 +2390,19 @@ dependencies = [ "snuggs>=1.4.1", ] files = [ - {file = "rasterio-1.3.9-cp310-cp310-macosx_10_15_x86_64.whl", hash = "sha256:04247da9f4002587ac2bec967c3a72f63fc0e6654101c06850bae3d8131b700d"}, - {file = "rasterio-1.3.9-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:c9edce37b70f4cd4be5d3f5d314877e3130aeebb612120405cd28f83fe200865"}, - {file = "rasterio-1.3.9-cp310-cp310-manylinux2014_x86_64.whl", hash = "sha256:fd6a850a37840ba590ddcf7ff90ba007b1e231b04434d8b4ac5ce0f746ada91a"}, - {file = "rasterio-1.3.9-cp310-cp310-win_amd64.whl", hash = "sha256:0c83156a44f8fda11876ff9f2ff1b602d7e7434447f7d621353f2929cefb1bf1"}, - {file = "rasterio-1.3.9-cp311-cp311-macosx_10_15_x86_64.whl", hash = "sha256:0172dbd80bd9adc105ec2c9bd207dbd5519ea06b438a4d965c6290ae8ed6ff9f"}, - {file = "rasterio-1.3.9-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:0ea5b42597d85868ee88c750cc33f2ae729e1b5e3fe28f99071f39e1417bf1c0"}, - {file = "rasterio-1.3.9-cp311-cp311-manylinux2014_x86_64.whl", hash = "sha256:be9b343bd08245df22115775dc9513c912afb4134d832662fa165d70cb805c34"}, - {file = "rasterio-1.3.9-cp311-cp311-win_amd64.whl", hash = "sha256:06d53e2e0885f039f960beb7c861400b92ea3e0e5abc2c67483fb56b1e5cbc13"}, - {file = "rasterio-1.3.9-cp312-cp312-macosx_10_15_x86_64.whl", hash = "sha256:a34bb9eef67b7896e2dfb39e10ba6372f9894226fb790bd7a46f5748f205b7d8"}, - {file = "rasterio-1.3.9-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:67b144b9678f9ad4cf5f2c3f455cbc6a7166c0523179249cee8f2e2c57d76c5b"}, - {file = "rasterio-1.3.9-cp312-cp312-manylinux2014_x86_64.whl", hash = "sha256:99b72fccb702a921f43e56a4507b4cafe2a9196b478b993b98e82ec6851916d7"}, - {file = "rasterio-1.3.9-cp312-cp312-win_amd64.whl", hash = "sha256:6777fad3c31eb3e5da0ccaa28a032ad07c20d003bcd14f8bc13e16ca2f62348c"}, - {file = "rasterio-1.3.9.tar.gz", hash = "sha256:fc6d0d290492fa1a5068711cfebb21cc936968891b7ed9da0690c8a7388885c5"}, + {file = "rasterio-1.3.10-cp310-cp310-macosx_10_15_x86_64.whl", hash = "sha256:2ef27c3eff6f44f8b5d5de228003367c1843593edf648d85c0dc1319c00dc57d"}, + {file = "rasterio-1.3.10-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:c711b497e9ef0c4f5e1c01e34ba910708e066e1c4a69c25df18d1bcc04481287"}, + {file = "rasterio-1.3.10-cp310-cp310-manylinux2014_x86_64.whl", hash = "sha256:d1ac85857144cb8075e332e9d908b65426d30ddc1f59f7a04bcf6ed6fd3c0d47"}, + {file = "rasterio-1.3.10-cp310-cp310-win_amd64.whl", hash = "sha256:ef8a496740df1e68f7a3d3449aa3be9c3210c22f4bb78a4a9e1c290183abd9b1"}, + {file = "rasterio-1.3.10-cp311-cp311-macosx_10_15_x86_64.whl", hash = "sha256:97d867cada29f16cb83f1743217f775f8b982676fcdda77671d25abb26698159"}, + {file = "rasterio-1.3.10-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:505b3e659eb3b137192c25233bf7954bc4997b1a474bae9e129fbd5ac2619404"}, + {file = "rasterio-1.3.10-cp311-cp311-manylinux2014_x86_64.whl", hash = "sha256:30f27e309a14a70c821d10a0ea18b110968dc2e2186b06a900aebd92094f4e00"}, + {file = "rasterio-1.3.10-cp311-cp311-win_amd64.whl", hash = "sha256:cbb2eea127328302f9e3158a000363a7d9eea22537378dee4f824a7fa2d78c05"}, + {file = "rasterio-1.3.10-cp312-cp312-macosx_10_15_x86_64.whl", hash = "sha256:3a9c4fb63e050e11bcd23e53f084ca186b445f976df1f70e7abd851c4072837f"}, + {file = "rasterio-1.3.10-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:7c7ddca79444fd3b933f4cd1a1773e9f7839d0ce5d76e600bdf92ee9a79b95f8"}, + {file = "rasterio-1.3.10-cp312-cp312-manylinux2014_x86_64.whl", hash = "sha256:f9cd757e11cfb07ef39b1cc79a32497bf22aff7fec41fe330b868cb3043b4db5"}, + {file = "rasterio-1.3.10-cp312-cp312-win_amd64.whl", hash = "sha256:7e653968f64840654d277e0f86f8666ed8f3030ba36fa865f420f9bc38d619ee"}, + {file = "rasterio-1.3.10.tar.gz", hash = "sha256:ce182c735b4f9e8735d90600607ecab15ef895eb8aa660bf665751529477e326"}, ] [[package]] @@ -2512,33 +2546,33 @@ files = [ [[package]] name = "scikit-learn" -version = "1.4.1.post1" +version = "1.4.2" requires_python = ">=3.9" summary = "A set of python modules for machine learning and data mining" groups = ["default"] dependencies = [ "joblib>=1.2.0", - "numpy<2.0,>=1.19.5", + "numpy>=1.19.5", "scipy>=1.6.0", "threadpoolctl>=2.0.0", ] files = [ - {file = "scikit-learn-1.4.1.post1.tar.gz", hash = "sha256:93d3d496ff1965470f9977d05e5ec3376fb1e63b10e4fda5e39d23c2d8969a30"}, - {file = "scikit_learn-1.4.1.post1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:c540aaf44729ab5cd4bd5e394f2b375e65ceaea9cdd8c195788e70433d91bbc5"}, - {file = "scikit_learn-1.4.1.post1-cp310-cp310-macosx_12_0_arm64.whl", hash = "sha256:4310bff71aa98b45b46cd26fa641309deb73a5d1c0461d181587ad4f30ea3c36"}, - {file = "scikit_learn-1.4.1.post1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9f43dd527dabff5521af2786a2f8de5ba381e182ec7292663508901cf6ceaf6e"}, - {file = "scikit_learn-1.4.1.post1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c02e27d65b0c7dc32f2c5eb601aaf5530b7a02bfbe92438188624524878336f2"}, - {file = "scikit_learn-1.4.1.post1-cp310-cp310-win_amd64.whl", hash = "sha256:629e09f772ad42f657ca60a1a52342eef786218dd20cf1369a3b8d085e55ef8f"}, - {file = "scikit_learn-1.4.1.post1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:6145dfd9605b0b50ae72cdf72b61a2acd87501369a763b0d73d004710ebb76b5"}, - {file = "scikit_learn-1.4.1.post1-cp311-cp311-macosx_12_0_arm64.whl", hash = "sha256:1afed6951bc9d2053c6ee9a518a466cbc9b07c6a3f9d43bfe734192b6125d508"}, - {file = "scikit_learn-1.4.1.post1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ce03506ccf5f96b7e9030fea7eb148999b254c44c10182ac55857bc9b5d4815f"}, - {file = "scikit_learn-1.4.1.post1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4ba516fcdc73d60e7f48cbb0bccb9acbdb21807de3651531208aac73c758e3ab"}, - {file = "scikit_learn-1.4.1.post1-cp311-cp311-win_amd64.whl", hash = "sha256:78cd27b4669513b50db4f683ef41ea35b5dddc797bd2bbd990d49897fd1c8a46"}, - {file = "scikit_learn-1.4.1.post1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:a1e289f33f613cefe6707dead50db31930530dc386b6ccff176c786335a7b01c"}, - {file = "scikit_learn-1.4.1.post1-cp312-cp312-macosx_12_0_arm64.whl", hash = "sha256:0df87de9ce1c0140f2818beef310fb2e2afdc1e66fc9ad587965577f17733649"}, - {file = "scikit_learn-1.4.1.post1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:712c1c69c45b58ef21635360b3d0a680ff7d83ac95b6f9b82cf9294070cda710"}, - {file = "scikit_learn-1.4.1.post1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1754b0c2409d6ed5a3380512d0adcf182a01363c669033a2b55cca429ed86a81"}, - {file = "scikit_learn-1.4.1.post1-cp312-cp312-win_amd64.whl", hash = "sha256:1d491ef66e37f4e812db7e6c8286520c2c3fc61b34bf5e59b67b4ce528de93af"}, + {file = "scikit-learn-1.4.2.tar.gz", hash = "sha256:daa1c471d95bad080c6e44b4946c9390a4842adc3082572c20e4f8884e39e959"}, + {file = "scikit_learn-1.4.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:8539a41b3d6d1af82eb629f9c57f37428ff1481c1e34dddb3b9d7af8ede67ac5"}, + {file = "scikit_learn-1.4.2-cp310-cp310-macosx_12_0_arm64.whl", hash = "sha256:68b8404841f944a4a1459b07198fa2edd41a82f189b44f3e1d55c104dbc2e40c"}, + {file = "scikit_learn-1.4.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:81bf5d8bbe87643103334032dd82f7419bc8c8d02a763643a6b9a5c7288c5054"}, + {file = "scikit_learn-1.4.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:36f0ea5d0f693cb247a073d21a4123bdf4172e470e6d163c12b74cbb1536cf38"}, + {file = "scikit_learn-1.4.2-cp310-cp310-win_amd64.whl", hash = "sha256:87440e2e188c87db80ea4023440923dccbd56fbc2d557b18ced00fef79da0727"}, + {file = "scikit_learn-1.4.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:45dee87ac5309bb82e3ea633955030df9bbcb8d2cdb30383c6cd483691c546cc"}, + {file = "scikit_learn-1.4.2-cp311-cp311-macosx_12_0_arm64.whl", hash = "sha256:1d0b25d9c651fd050555aadd57431b53d4cf664e749069da77f3d52c5ad14b3b"}, + {file = "scikit_learn-1.4.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b0203c368058ab92efc6168a1507d388d41469c873e96ec220ca8e74079bf62e"}, + {file = "scikit_learn-1.4.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:44c62f2b124848a28fd695db5bc4da019287abf390bfce602ddc8aa1ec186aae"}, + {file = "scikit_learn-1.4.2-cp311-cp311-win_amd64.whl", hash = "sha256:5cd7b524115499b18b63f0c96f4224eb885564937a0b3477531b2b63ce331904"}, + {file = "scikit_learn-1.4.2-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:90378e1747949f90c8f385898fff35d73193dfcaec3dd75d6b542f90c4e89755"}, + {file = "scikit_learn-1.4.2-cp312-cp312-macosx_12_0_arm64.whl", hash = "sha256:ff4effe5a1d4e8fed260a83a163f7dbf4f6087b54528d8880bab1d1377bd78be"}, + {file = "scikit_learn-1.4.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:671e2f0c3f2c15409dae4f282a3a619601fa824d2c820e5b608d9d775f91780c"}, + {file = "scikit_learn-1.4.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d36d0bc983336bbc1be22f9b686b50c964f593c8a9a913a792442af9bf4f5e68"}, + {file = "scikit_learn-1.4.2-cp312-cp312-win_amd64.whl", hash = "sha256:d762070980c17ba3e9a4a1e043ba0518ce4c55152032f1af0ca6f39b376b5928"}, ] [[package]] @@ -2596,36 +2630,36 @@ files = [ [[package]] name = "shapely" -version = "2.0.3" +version = "2.0.4" requires_python = ">=3.7" summary = "Manipulation and analysis of geometric objects" groups = ["default", "dev"] dependencies = [ - "numpy<2,>=1.14", -] -files = [ - {file = "shapely-2.0.3-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:af7e9abe180b189431b0f490638281b43b84a33a960620e6b2e8d3e3458b61a1"}, - {file = "shapely-2.0.3-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:98040462b36ced9671e266b95c326b97f41290d9d17504a1ee4dc313a7667b9c"}, - {file = "shapely-2.0.3-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:71eb736ef2843f23473c6e37f6180f90f0a35d740ab284321548edf4e55d9a52"}, - {file = "shapely-2.0.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:881eb9dbbb4a6419667e91fcb20313bfc1e67f53dbb392c6840ff04793571ed1"}, - {file = "shapely-2.0.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f10d2ccf0554fc0e39fad5886c839e47e207f99fdf09547bc687a2330efda35b"}, - {file = "shapely-2.0.3-cp310-cp310-win32.whl", hash = "sha256:6dfdc077a6fcaf74d3eab23a1ace5abc50c8bce56ac7747d25eab582c5a2990e"}, - {file = "shapely-2.0.3-cp310-cp310-win_amd64.whl", hash = "sha256:64c5013dacd2d81b3bb12672098a0b2795c1bf8190cfc2980e380f5ef9d9e4d9"}, - {file = "shapely-2.0.3-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:56cee3e4e8159d6f2ce32e421445b8e23154fd02a0ac271d6a6c0b266a8e3cce"}, - {file = "shapely-2.0.3-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:619232c8276fded09527d2a9fd91a7885ff95c0ff9ecd5e3cb1e34fbb676e2ae"}, - {file = "shapely-2.0.3-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:b2a7d256db6f5b4b407dc0c98dd1b2fcf1c9c5814af9416e5498d0a2e4307a4b"}, - {file = "shapely-2.0.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e45f0c8cd4583647db3216d965d49363e6548c300c23fd7e57ce17a03f824034"}, - {file = "shapely-2.0.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:13cb37d3826972a82748a450328fe02a931dcaed10e69a4d83cc20ba021bc85f"}, - {file = "shapely-2.0.3-cp311-cp311-win32.whl", hash = "sha256:9302d7011e3e376d25acd30d2d9e70d315d93f03cc748784af19b00988fc30b1"}, - {file = "shapely-2.0.3-cp311-cp311-win_amd64.whl", hash = "sha256:6b464f2666b13902835f201f50e835f2f153f37741db88f68c7f3b932d3505fa"}, - {file = "shapely-2.0.3-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:e86e7cb8e331a4850e0c2a8b2d66dc08d7a7b301b8d1d34a13060e3a5b4b3b55"}, - {file = "shapely-2.0.3-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:c91981c99ade980fc49e41a544629751a0ccd769f39794ae913e53b07b2f78b9"}, - {file = "shapely-2.0.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:bd45d456983dc60a42c4db437496d3f08a4201fbf662b69779f535eb969660af"}, - {file = "shapely-2.0.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:882fb1ffc7577e88c1194f4f1757e277dc484ba096a3b94844319873d14b0f2d"}, - {file = "shapely-2.0.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b9f2d93bff2ea52fa93245798cddb479766a18510ea9b93a4fb9755c79474889"}, - {file = "shapely-2.0.3-cp312-cp312-win32.whl", hash = "sha256:99abad1fd1303b35d991703432c9481e3242b7b3a393c186cfb02373bf604004"}, - {file = "shapely-2.0.3-cp312-cp312-win_amd64.whl", hash = "sha256:6f555fe3304a1f40398977789bc4fe3c28a11173196df9ece1e15c5bc75a48db"}, - {file = "shapely-2.0.3.tar.gz", hash = "sha256:4d65d0aa7910af71efa72fd6447e02a8e5dd44da81a983de9d736d6e6ccbe674"}, + "numpy<3,>=1.14", +] +files = [ + {file = "shapely-2.0.4-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:011b77153906030b795791f2fdfa2d68f1a8d7e40bce78b029782ade3afe4f2f"}, + {file = "shapely-2.0.4-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:9831816a5d34d5170aa9ed32a64982c3d6f4332e7ecfe62dc97767e163cb0b17"}, + {file = "shapely-2.0.4-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:5c4849916f71dc44e19ed370421518c0d86cf73b26e8656192fcfcda08218fbd"}, + {file = "shapely-2.0.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:841f93a0e31e4c64d62ea570d81c35de0f6cea224568b2430d832967536308e6"}, + {file = "shapely-2.0.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d2b4431f522b277c79c34b65da128029a9955e4481462cbf7ebec23aab61fc58"}, + {file = "shapely-2.0.4-cp310-cp310-win32.whl", hash = "sha256:92a41d936f7d6743f343be265ace93b7c57f5b231e21b9605716f5a47c2879e7"}, + {file = "shapely-2.0.4-cp310-cp310-win_amd64.whl", hash = "sha256:30982f79f21bb0ff7d7d4a4e531e3fcaa39b778584c2ce81a147f95be1cd58c9"}, + {file = "shapely-2.0.4-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:de0205cb21ad5ddaef607cda9a3191eadd1e7a62a756ea3a356369675230ac35"}, + {file = "shapely-2.0.4-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:7d56ce3e2a6a556b59a288771cf9d091470116867e578bebced8bfc4147fbfd7"}, + {file = "shapely-2.0.4-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:58b0ecc505bbe49a99551eea3f2e8a9b3b24b3edd2a4de1ac0dc17bc75c9ec07"}, + {file = "shapely-2.0.4-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:790a168a808bd00ee42786b8ba883307c0e3684ebb292e0e20009588c426da47"}, + {file = "shapely-2.0.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4310b5494271e18580d61022c0857eb85d30510d88606fa3b8314790df7f367d"}, + {file = "shapely-2.0.4-cp311-cp311-win32.whl", hash = "sha256:63f3a80daf4f867bd80f5c97fbe03314348ac1b3b70fb1c0ad255a69e3749879"}, + {file = "shapely-2.0.4-cp311-cp311-win_amd64.whl", hash = "sha256:c52ed79f683f721b69a10fb9e3d940a468203f5054927215586c5d49a072de8d"}, + {file = "shapely-2.0.4-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:5bbd974193e2cc274312da16b189b38f5f128410f3377721cadb76b1e8ca5328"}, + {file = "shapely-2.0.4-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:41388321a73ba1a84edd90d86ecc8bfed55e6a1e51882eafb019f45895ec0f65"}, + {file = "shapely-2.0.4-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:0776c92d584f72f1e584d2e43cfc5542c2f3dd19d53f70df0900fda643f4bae6"}, + {file = "shapely-2.0.4-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c75c98380b1ede1cae9a252c6dc247e6279403fae38c77060a5e6186c95073ac"}, + {file = "shapely-2.0.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c3e700abf4a37b7b8b90532fa6ed5c38a9bfc777098bc9fbae5ec8e618ac8f30"}, + {file = "shapely-2.0.4-cp312-cp312-win32.whl", hash = "sha256:4f2ab0faf8188b9f99e6a273b24b97662194160cc8ca17cf9d1fb6f18d7fb93f"}, + {file = "shapely-2.0.4-cp312-cp312-win_amd64.whl", hash = "sha256:03152442d311a5e85ac73b39680dd64a9892fa42bb08fd83b3bab4fe6999bfa0"}, + {file = "shapely-2.0.4.tar.gz", hash = "sha256:5dc736127fac70009b8d309a0eeb74f3e08979e530cf7017f2f507ef62e6cfb8"}, ] [[package]] @@ -2879,7 +2913,7 @@ files = [ [[package]] name = "types-requests" -version = "2.31.0.20240311" +version = "2.31.0.20240406" requires_python = ">=3.8" summary = "Typing stubs for requests" groups = ["dev"] @@ -2887,8 +2921,8 @@ dependencies = [ "urllib3>=2", ] files = [ - {file = "types-requests-2.31.0.20240311.tar.gz", hash = "sha256:b1c1b66abfb7fa79aae09097a811c4aa97130eb8831c60e47aee4ca344731ca5"}, - {file = "types_requests-2.31.0.20240311-py3-none-any.whl", hash = "sha256:47872893d65a38e282ee9f277a4ee50d1b28bd592040df7d1fdaffdf3779937d"}, + {file = "types-requests-2.31.0.20240406.tar.gz", hash = "sha256:4428df33c5503945c74b3f42e82b181e86ec7b724620419a2966e2de604ce1a1"}, + {file = "types_requests-2.31.0.20240406-py3-none-any.whl", hash = "sha256:6216cdac377c6b9a040ac1c0404f7284bd13199c0e1bb235f4324627e8898cf5"}, ] [[package]] diff --git a/pyproject.toml b/pyproject.toml index 089277f3..668a7921 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "cityseer" -version = '4.12.0' +version = '4.13.0' description = "Computational tools for network-based pedestrian-scale urban analysis" readme = "README.md" requires-python = ">=3.10, <3.13" @@ -46,6 +46,7 @@ dependencies = [ "numpy>=1.23.3", "geopandas>=0.12.2", "rasterio>=1.3.9", + "pyarrow>=16.0.0", ] [project.urls] diff --git a/pysrc/cityseer/tools/graphs.py b/pysrc/cityseer/tools/graphs.py index 1116986e..26fde69c 100644 --- a/pysrc/cityseer/tools/graphs.py +++ b/pysrc/cityseer/tools/graphs.py @@ -1175,12 +1175,10 @@ def nx_to_dual(nx_multigraph: MultiGraph) -> MultiGraph: A dual representation `networkX` graph. The new dual nodes will have `x` and `y` node attributes corresponding to the mid-points of the original primal edges. If `live` node attributes were provided, then the `live` attribute for the new dual nodes will be set to `True` if either or both of the adjacent primal nodes were set - to `live=True`. Otherwise, all dual nodes wil be set to `live=True`. The primal `geom` edge attributes will be - split and welded to form the new dual `geom` edge attributes. `primal_edge_node_a`, `primal_edge_node_b`, and - `primal_edge_idx` attributes will be added to the new (dual) nodes, and a `primal_node_id` edge attribute - will be added to the new (dual) edges. This is useful for welding the primal geometry to the dual - representations where useful for purposes such as visualisation, or otherwise welding downstream metrics to - source (primal) geometries. + to `live=True`. Otherwise, all dual nodes wil be set to `live=True`. The primal edges will be split and welded + to form the new dual `geom` edges. The primal `LineString` `geom` will be saved to the dual node's `primal_edge` + attribute. `primal_edge_node_a`, `primal_edge_node_b`, and `primal_edge_idx` attributes will be added to the new + (dual) nodes, and a `primal_node_id` edge attribute will be added to the new (dual) edges. Examples -------- @@ -1285,13 +1283,15 @@ def prepare_dual_node_key(start_nd_key: NodeKey, end_nd_key: NodeKey, edge_idx: for start_nd_key, end_nd_key, edge_idx, edge_data in tqdm( # type: ignore nx_multigraph.edges(data=True, keys=True), disable=config.QUIET_MODE # type: ignore ): - mid_point = edge_data["geom"].interpolate(0.5, normalized=True) # type: ignore + primal_geom = edge_data["geom"] + mid_point = primal_geom.interpolate(0.5, normalized=True) # type: ignore dual_node_key = prepare_dual_node_key(start_nd_key, end_nd_key, edge_idx) # create a new dual node corresponding to the current primal edge g_dual.add_node( dual_node_key, x=mid_point.x, y=mid_point.y, + primal_edge=primal_geom, primal_edge_node_a=start_nd_key, primal_edge_node_b=end_nd_key, primal_edge_idx=edge_idx, diff --git a/pysrc/cityseer/tools/io.py b/pysrc/cityseer/tools/io.py index acacf3bd..54bfb2ad 100644 --- a/pysrc/cityseer/tools/io.py +++ b/pysrc/cityseer/tools/io.py @@ -709,7 +709,10 @@ def network_structure_from_nx( ------- gpd.GeoDataFrame A `gpd.GeoDataFrame` with `live`, `weight`, and `geometry` attributes. The original `networkX` graph's node keys - will be used for the `GeoDataFrame` index. + will be used for the `GeoDataFrame` index. If `nx_multigraph` is a dual graph prepared with + [`graphs.nx_to_dual`](/tools/graphs#nx-to-dual) then the corresponding primal edge `LineString` geometry will be + set as the `GeoPandas` geometry for visualisation purposes using `primal_edge` for the column name. The dual + node `Point` geometry will be saved in `WKT` format to the `dual_node` column. gpd.GeoDataFrame A `gpd.GeoDataFrame` with `ns_edge_idx`, `start_ns_node_idx`, `end_ns_node_idx`, `edge_idx`, `nx_start_node_key` ,`nx_end_node_key`, `length`, `angle_sum`, `imp_factor`, `in_bearing`, `out_bearing`, `total_bearing`, `geom` @@ -726,7 +729,7 @@ def network_structure_from_nx( network_structure = rustalgos.NetworkStructure() # generate the network information agg_node_data: dict[str, tuple[Any, ...]] = {} - agg_node_dual_data: dict[str, tuple[Any, Any, Any]] = {} + agg_node_dual_data: dict[str, tuple[Any, Any, Any, Any]] = {} agg_edge_data: dict[str, tuple[Any, ...]] = {} agg_edge_dual_data: list[str] = [] node_data: NodeData @@ -752,6 +755,7 @@ def network_structure_from_nx( agg_node_data[node_key] = (ns_node_idx, node_x, node_y, is_live, weight, geometry.Point(node_x, node_y)) if "is_dual" in g_multi_copy.graph and g_multi_copy.graph["is_dual"]: # type: ignore agg_node_dual_data[node_key] = ( + node_data["primal_edge"], node_data["primal_edge_node_a"], node_data["primal_edge_node_b"], node_data["primal_edge_idx"], @@ -878,13 +882,18 @@ def network_structure_from_nx( agg_node_dual_data, orient="index", columns=[ + "primal_edge", "primal_edge_node_a", "primal_edge_node_b", "primal_edge_idx", ], ) - nodes_gdf: gpd.GeoDataFrame = nodes_gdf.join(nodes_dual_gdf) # type: ignore edges_gdf["primal_node_id"] = agg_edge_dual_data + nodes_gdf: gpd.GeoDataFrame = nodes_gdf.join(nodes_dual_gdf) # type: ignore + nodes_gdf.set_geometry("primal_edge", inplace=True) + nodes_gdf["dual_node"] = nodes_gdf["geom"].to_wkt() # type: ignore + nodes_gdf.drop(columns=["geom"], inplace=True) + return nodes_gdf, edges_gdf, network_structure @@ -902,10 +911,10 @@ def network_structure_from_gpd( Parameters ---------- - gpd.GeoDataFrame + nodes_gdf: gpd.GeoDataFrame A cityseer created nodes `gpd.GeoDataFrame` where the originating `networkX` graph's node keys have been saved as the DataFrame index, and where the columns contain `x`, `y`, `live`, and `weight` attributes. - gpd.GeoDataFrame + edges_gdf: gpd.GeoDataFrame A cityseer created edges `gpd.GeoDataFrame` with `start_ns_node_idx`, `end_ns_node_idx`, `edge_idx`, `nx_start_node_key`, `nx_end_node_key`, `length`, `angle_sum`, `imp_factor`, `in_bearing`, `out_bearing` attributes. @@ -914,6 +923,7 @@ def network_structure_from_gpd( ------- rustalgos.NetworkStructure A [`rustalgos.NetworkStructure`](/rustalgos/rustalgos#networkstructure) instance. + """ # prepare the network structure network_structure = rustalgos.NetworkStructure() diff --git a/pysrc/cityseer/tools/plot.py b/pysrc/cityseer/tools/plot.py index 764a8099..62c337ad 100644 --- a/pysrc/cityseer/tools/plot.py +++ b/pysrc/cityseer/tools/plot.py @@ -683,8 +683,7 @@ def plot_scatter( face_colour: str = "#111", ) -> Any: """ - Convenience plotting function for plotting outputs from examples in the - [Cityseer Guide](https://benchmark-urbanism.github.io/cityseer-examples/). + Convenience plotting function for plotting outputs from examples in the Cityseer Guide. Parameters ---------- @@ -776,8 +775,7 @@ def plot_nx_edges( invert_plot_order: bool = False, ): """ - Convenience plotting function for plotting outputs from examples in the - [Cityseer Guide](https://benchmark-urbanism.github.io/cityseer-examples/). + Convenience plotting function for plotting outputs from examples in the Cityseer Guide. Parameters ---------- diff --git a/tests/rustalgos/test_centrality.py b/tests/rustalgos/test_centrality.py index cb948d1a..01975d20 100644 --- a/tests/rustalgos/test_centrality.py +++ b/tests/rustalgos/test_centrality.py @@ -58,9 +58,9 @@ def test_closest_intersections(box_graph): def override_coords(nx_multigraph: nx.MultiGraph) -> gpd.GeoDataFrame: """Some tweaks for visual checks.""" data_gdf = mock.mock_data_gdf(nx_multigraph, random_seed=25) - data_gdf.geometry.iloc[18] = geometry.Point(701200, 5719400) - data_gdf.geometry.iloc[39] = geometry.Point(700750, 5720025) - data_gdf.geometry.iloc[26] = geometry.Point(700400, 5719525) + data_gdf.loc["18", "geometry"] = geometry.Point(701200, 5719400) + data_gdf.loc["39", "geometry"] = geometry.Point(700750, 5720025) + data_gdf.loc["26", "geometry"] = geometry.Point(700400, 5719525) return data_gdf @@ -138,11 +138,12 @@ def test_assign_to_network(primal_graph): # should be None n, n_n = network_structure.assign_to_network(data_coord, 0) assert n == None and n_n == None + # from cityseer.tools import plot + # from cityseer.metrics import layers + # data_map, data_gdf = layers.assign_gdf_to_network(data_gdf, network_structure, 1600) # plot.plot_network_structure(network_structure, data_gdf) # plot.plot_assignment(network_structure, G, data_gdf) - # for idx in range(data_map_1600.count): - # print(idx, data_map_1600.nearest_assign[idx], data_map_1600.next_nearest_assign[idx]) def find_path(start_idx, target_idx, tree_map): diff --git a/tests/tools/test_graphs.py b/tests/tools/test_graphs.py index d941df95..d4cebe4e 100644 --- a/tests/tools/test_graphs.py +++ b/tests/tools/test_graphs.py @@ -496,11 +496,14 @@ def test_nx_to_dual(primal_graph, diamond_graph): assert G_dual.number_of_nodes() == 5 assert G_dual.number_of_edges() == 8 # the new dual nodes have three edges each, except for the midspan which now has four redges - for n in G_dual.nodes(): + for n, d in G_dual.nodes(data=True): if n == "1_2_k0": assert nx.degree(G_dual, n) == 4 else: assert nx.degree(G_dual, n) == 3 + # check that the primal geoms were copied to dual nodes + primal_geom = G[d["primal_edge_node_a"]][d["primal_edge_node_b"]][d["primal_edge_idx"]]["geom"] + assert d["primal_edge"] == primal_geom for start, end, d in G_dual.edges(data=True): # the new geoms should also be 100m length (split 50m x 2) assert round(d["geom"].length) == 100 diff --git a/tests/tools/test_io.py b/tests/tools/test_io.py index 0ab7e503..090650c1 100644 --- a/tests/tools/test_io.py +++ b/tests/tools/test_io.py @@ -220,6 +220,14 @@ def test_network_structure_from_nx(diamond_graph): assert len(nodes_gdf) == (network_structure.node_count()) == G.number_of_nodes() # edges = x2 assert network_structure.edge_count == G.number_of_edges() * 2 + # dual specific checks + if is_dual is True: + # check that primal geom is copied across + for _row_idx, row in nodes_gdf.iterrows(): # type: ignore + assert ( + row["primal_edge"] + == G_test[row["primal_edge_node_a"]][row["primal_edge_node_b"]][row["primal_edge_idx"]]["geom"] + ) # check node maps (idx and label match in this case...) node_idxs = network_structure.node_indices() for node_idx in node_idxs: diff --git a/tests/tools/test_util.py b/tests/tools/test_util.py index bc13392f..0ac8d2a8 100644 --- a/tests/tools/test_util.py +++ b/tests/tools/test_util.py @@ -2,7 +2,6 @@ from __future__ import annotations import pytest -from shapely import geometry from cityseer.metrics import networks from cityseer.tools import io, util