From 9918113b62e769294d3e983eedb6631b4b600903 Mon Sep 17 00:00:00 2001 From: Dobson Date: Thu, 12 Dec 2024 11:04:11 +0000 Subject: [PATCH 1/4] Update design_graphfcns.py --- src/swmmanywhere/graphfcns/design_graphfcns.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/swmmanywhere/graphfcns/design_graphfcns.py b/src/swmmanywhere/graphfcns/design_graphfcns.py index f6a90dec..e3fe865a 100644 --- a/src/swmmanywhere/graphfcns/design_graphfcns.py +++ b/src/swmmanywhere/graphfcns/design_graphfcns.py @@ -151,12 +151,13 @@ def process_successors( hydraulic_design (parameters.HydraulicDesign): A HydraulicDesign parameter object """ + anc = nx.ancestors(G, node).union([node]) + tot = sum([G.nodes[anc_node]["contributing_area"] for anc_node in anc]) + for ix, ds_node in enumerate(G.successors(node)): edge = G.get_edge_data(node, ds_node, 0) # Find contributing area with ancestors # TODO - could do timearea here if i hated myself enough - anc = nx.ancestors(G, node).union([node]) - tot = sum([G.nodes[anc_node]["contributing_area"] for anc_node in anc]) M3_PER_HR_TO_M3_PER_S = 1 / 60 / 60 Q = tot * hydraulic_design.precipitation * M3_PER_HR_TO_M3_PER_S From 6f05fc3ae3de42b7323bd5072cf8cb3404725b11 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 12 Dec 2024 11:05:12 +0000 Subject: [PATCH 2/4] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/swmmanywhere/graphfcns/design_graphfcns.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/swmmanywhere/graphfcns/design_graphfcns.py b/src/swmmanywhere/graphfcns/design_graphfcns.py index e3fe865a..9775445b 100644 --- a/src/swmmanywhere/graphfcns/design_graphfcns.py +++ b/src/swmmanywhere/graphfcns/design_graphfcns.py @@ -153,7 +153,7 @@ def process_successors( """ anc = nx.ancestors(G, node).union([node]) tot = sum([G.nodes[anc_node]["contributing_area"] for anc_node in anc]) - + for ix, ds_node in enumerate(G.successors(node)): edge = G.get_edge_data(node, ds_node, 0) # Find contributing area with ancestors From 9fc06e5451021d93a43be72c1f66cb37202d99f5 Mon Sep 17 00:00:00 2001 From: Dobson Date: Thu, 12 Dec 2024 11:18:38 +0000 Subject: [PATCH 3/4] Update design_graphfcns.py --- src/swmmanywhere/graphfcns/design_graphfcns.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/swmmanywhere/graphfcns/design_graphfcns.py b/src/swmmanywhere/graphfcns/design_graphfcns.py index e3fe865a..39f6037f 100644 --- a/src/swmmanywhere/graphfcns/design_graphfcns.py +++ b/src/swmmanywhere/graphfcns/design_graphfcns.py @@ -153,14 +153,15 @@ def process_successors( """ anc = nx.ancestors(G, node).union([node]) tot = sum([G.nodes[anc_node]["contributing_area"] for anc_node in anc]) + M3_PER_HR_TO_M3_PER_S = 1 / 60 / 60 + Q = tot * hydraulic_design.precipitation * M3_PER_HR_TO_M3_PER_S for ix, ds_node in enumerate(G.successors(node)): edge = G.get_edge_data(node, ds_node, 0) # Find contributing area with ancestors # TODO - could do timearea here if i hated myself enough - M3_PER_HR_TO_M3_PER_S = 1 / 60 / 60 - Q = tot * hydraulic_design.precipitation * M3_PER_HR_TO_M3_PER_S + # Design the pipe to find the diameter and invert depth diam, depth = design_pipe( From 5d83e07f529309deced0080eebe9f4a497b25566 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 12 Dec 2024 11:19:40 +0000 Subject: [PATCH 4/4] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/swmmanywhere/graphfcns/design_graphfcns.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/swmmanywhere/graphfcns/design_graphfcns.py b/src/swmmanywhere/graphfcns/design_graphfcns.py index a244436c..e6966109 100644 --- a/src/swmmanywhere/graphfcns/design_graphfcns.py +++ b/src/swmmanywhere/graphfcns/design_graphfcns.py @@ -157,7 +157,7 @@ def process_successors( tot = sum([G.nodes[anc_node]["contributing_area"] for anc_node in anc]) M3_PER_HR_TO_M3_PER_S = 1 / 60 / 60 Q = tot * hydraulic_design.precipitation * M3_PER_HR_TO_M3_PER_S - + for ix, ds_node in enumerate(G.successors(node)): edge = G.get_edge_data(node, ds_node, 0)