Add diameter to getmajornodes/getmajorpipes

This commit is contained in:
DingZQ
2025-01-01 10:19:12 +08:00
parent 51e3ae18bb
commit 9e7a4616b4
3 changed files with 12 additions and 12 deletions

View File

@@ -846,9 +846,9 @@ def get_network_node_coords(name: str) -> dict[str, dict[str, float]]:
# DingZQ 2024-12-31
# id, x, y, type
def get_major_node_coords(name: str) -> dict[str, dict[str, float]]:
def get_major_node_coords(name: str, diameter: int) -> dict[str, dict[str, float]]:
nodes_id_and_type = api.get_nodes_id_and_type(name)
major_node_ids = api.get_major_nodes(name)
major_node_ids = api.get_major_nodes(name, diameter)
result = {}
for node_id in major_node_ids:
coord = api.get_node_coord(name, node_id)
@@ -868,8 +868,8 @@ def get_network_link_nodes(name: str) -> list[str]:
# DingZQ 2024-12-31
# link_id:pipe:node_id1:node_id2
def get_major_pipe_nodes(name: str) -> list[str]:
major_pipe_ids = api.get_major_pipes(name)
def get_major_pipe_nodes(name: str, diameter: int) -> list[str]:
major_pipe_ids = api.get_major_pipes(name, diameter)
result = []
for link_id in major_pipe_ids:
nodes = api.get_link_nodes(name, link_id)