Supplement example
This commit is contained in:
@@ -323,7 +323,7 @@ def get_valve(name: str, id: str) -> dict[str, Any]:
|
||||
def set_valve(name: str, cs: ChangeSet) -> ChangeSet:
|
||||
return api.set_valve(name, cs)
|
||||
|
||||
#example: add_valve(p, ChangeSet({'id': 'v0', 'node1': 'j1', 'node2': 'j2', 'diameter': 10.0, 'v_type': VALVES_TYPE_FCV, 'setting': 0.1, 'minor_loss': 0.5 }))
|
||||
# example: add_valve(p, ChangeSet({'id': 'v0', 'node1': 'j1', 'node2': 'j2', 'diameter': 10.0, 'v_type': VALVES_TYPE_FCV, 'setting': 0.1, 'minor_loss': 0.5 }))
|
||||
def add_valve(name: str, cs: ChangeSet) -> ChangeSet:
|
||||
return api.add_valve(name, cs)
|
||||
|
||||
@@ -341,7 +341,7 @@ def get_demand_schema(name: str) -> dict[str, dict[str, Any]]:
|
||||
def get_demand(name: str, junction: str) -> dict[str, Any]:
|
||||
return api.get_demand(name, junction)
|
||||
|
||||
# { 'operation': 'update', 'type': 'demand', 'junction': 'j1', 'demands': [{'demand': 0.0, 'patten': None, 'category': None}] }
|
||||
# example: set_demand(p, ChangeSet({'junction': 'j1', 'demands': [{'demand': 10.0, 'pattern': None, 'category': 'x'}, {'demand': 20.0, 'pattern': None, 'category': None}]}))
|
||||
def set_demand(name: str, cs: ChangeSet) -> ChangeSet:
|
||||
return api.set_demand(name, cs)
|
||||
|
||||
@@ -356,6 +356,7 @@ def get_status_schema(name: str) -> dict[str, dict[str, Any]]:
|
||||
def get_status(name: str, link: str) -> dict[str, Any]:
|
||||
return api.get_status(name, link)
|
||||
|
||||
# example: set_status(p, ChangeSet({'link': 'p0', 'status': LINK_STATUS_OPEN, 'setting': 10.0}))
|
||||
def set_status(name: str, cs: ChangeSet) -> ChangeSet:
|
||||
return api.set_status(name, cs)
|
||||
|
||||
@@ -370,6 +371,7 @@ def get_pattern_schema(name: str) -> dict[str, dict[str, Any]]:
|
||||
def get_pattern(name: str, id: str) -> dict[str, Any]:
|
||||
return api.get_pattern(name, id)
|
||||
|
||||
# example: set_pattern(p, ChangeSet({'id' : 'p0', 'factors': [1.0, 2.0, 3.0]}))
|
||||
def set_pattern(name: str, cs: ChangeSet) -> ChangeSet:
|
||||
return api.set_pattern(name, cs)
|
||||
|
||||
@@ -384,6 +386,7 @@ def get_curve_schema(name: str) -> dict[str, dict[str, Any]]:
|
||||
def get_curve(name: str, id: str) -> dict[str, Any]:
|
||||
return api.get_curve(name, id)
|
||||
|
||||
# example: set_curve(p, ChangeSet({'id' : 'c0', 'coords': [{'x': 1.0, 'y': 2.0}, {'x': 2.0, 'y': 1.0}]}))
|
||||
def set_curve(name: str, cs: ChangeSet) -> ChangeSet:
|
||||
return api.set_curve(name, cs)
|
||||
|
||||
@@ -398,6 +401,7 @@ def get_emitter_schema(name: str) -> dict[str, dict[str, Any]]:
|
||||
def get_emitter(name: str, junction: str) -> dict[str, Any]:
|
||||
return api.get_emitter(name, junction)
|
||||
|
||||
# example: set_emitter(p, ChangeSet({'junction': 'j1', 'coefficient': 10.0}))
|
||||
def set_emitter(name: str, cs: ChangeSet) -> ChangeSet:
|
||||
return api.set_emitter(name, cs)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user