Refine
This commit is contained in:
19
main.py
19
main.py
@@ -1693,18 +1693,17 @@ async def fastapi_generate_virtual_district(network: str, centers: list[str]) ->
|
|||||||
############################################################
|
############################################################
|
||||||
# water_distribution_area 36
|
# water_distribution_area 36
|
||||||
############################################################
|
############################################################
|
||||||
|
@app.get('/calculatedemandtonodes/')
|
||||||
|
async def fastapi_calculate_demand_to_nodes(network: str, demand: float, nodes: list[str]) -> dict[str, float]:
|
||||||
|
return calculate_demand_to_nodes(network, demand, nodes)
|
||||||
|
|
||||||
def calculate_demand_to_nodes(name: str, demand: float, nodes: list[str]) -> dict[str, float]:
|
@app.get('/calculatedemandtoregion/')
|
||||||
return api.calculate_demand_to_nodes(name, demand, nodes)
|
async def fastapi_calculate_demand_to_region(network: str, demand: float, region: str) -> dict[str, float]:
|
||||||
|
return calculate_demand_to_region(network, demand, region)
|
||||||
|
|
||||||
# if region is general or wda => get_nodes_in_boundary
|
@app.get('/calculatedemandtonetwork/')
|
||||||
# if region is dma, sa or vd => get stored nodes in table
|
async def fastapi_calculate_demand_to_network(network: str, demand: float) -> dict[str, float]:
|
||||||
# TODO: more test
|
return calculate_demand_to_network(network, demand)
|
||||||
def calculate_demand_to_region(name: str, demand: float, region: str) -> dict[str, float]:
|
|
||||||
return api.calculate_demand_to_region(name, demand, region)
|
|
||||||
|
|
||||||
def calculate_demand_to_network(name: str, demand: float) -> dict[str, float]:
|
|
||||||
return api.calculate_demand_to_network(name, demand)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user