From 786bb0d8e1ef53080866af3b4c634171892ddeaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrik=20Sch=C3=B6nfeldt?= Date: Wed, 4 Dec 2024 16:02:44 +0100 Subject: [PATCH 1/2] Update example osm_invest osmnx renamed geometries_from_polygon to features_from_polygon and removed the column "node". --- .../optimisation/import_osm_invest/import_osm_invest.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/examples/optimisation/import_osm_invest/import_osm_invest.py b/examples/optimisation/import_osm_invest/import_osm_invest.py index e795fe59..aa4523c8 100644 --- a/examples/optimisation/import_osm_invest/import_osm_invest.py +++ b/examples/optimisation/import_osm_invest/import_osm_invest.py @@ -70,17 +70,13 @@ graph = ox.graph_from_polygon(polygon, network_type='drive_service') ox.plot_graph(graph) -gdf_poly_houses = ox.geometries_from_polygon(polygon, tags=buildings) -gdf_lines_streets = ox.geometries_from_polygon(polygon, tags=streets) +gdf_poly_houses = ox.features_from_polygon(polygon, tags=buildings) +gdf_lines_streets = ox.features_from_polygon(polygon, tags=streets) # Make sure that only polygon geometries are used gdf_poly_houses = gdf_poly_houses[gdf_poly_houses['geometry'].apply( lambda x: isinstance(x, geometry.Polygon))] -# Remove nodes column (that make somehow trouble for exporting .geojson) -gdf_poly_houses.drop(columns=['nodes'], inplace=True) -gdf_lines_streets.drop(columns=['nodes'], inplace=True) - # We need one (or more) buildings that we call "generators". # Choose one among the buildings at random and move it to a new GeoDataFrame np.random.seed(42) From 28e5d068edcc38ce4ae6869109f233370fef6f3a Mon Sep 17 00:00:00 2001 From: Joris Nettelstroth Date: Fri, 17 Jan 2025 11:16:50 +0100 Subject: [PATCH 2/2] Fix description of pressure unit from 'bar' to 'Pa' --- dhnx/optimization/precalc_hydraulic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dhnx/optimization/precalc_hydraulic.py b/dhnx/optimization/precalc_hydraulic.py index 4239717e..7ce82a0e 100644 --- a/dhnx/optimization/precalc_hydraulic.py +++ b/dhnx/optimization/precalc_hydraulic.py @@ -354,7 +354,7 @@ def delta_p(v, d_i, k=0.1, T_medium=90, length=1, Returns ------- - Pressure drop [bar] : numeric + Pressure drop [Pa] : numeric """ k = k * 0.001