Format schema

This commit is contained in:
WQY\qiong
2022-10-21 20:31:06 +08:00
parent a3e491091e
commit a48c21f49b
6 changed files with 31 additions and 31 deletions

View File

@@ -7,10 +7,10 @@ def get_junction_schema(name: str) -> dict[str, dict[str, Any]]:
return { 'id' : {'type': 'str' , 'optional': False , 'readonly': True },
'x' : {'type': 'float' , 'optional': False , 'readonly': False},
'y' : {'type': 'float' , 'optional': False , 'readonly': False},
'elevation' : {'type': "float" , 'optional': False , 'readonly': False},
'demand' : {'type': "float" , 'optional': True , 'readonly': False},
'pattern' : {'type': "str" , 'optional': True , 'readonly': False},
'links' : {'type': "str_list" , 'optional': False , 'readonly': True } }
'elevation' : {'type': 'float' , 'optional': False , 'readonly': False},
'demand' : {'type': 'float' , 'optional': True , 'readonly': False},
'pattern' : {'type': 'str' , 'optional': True , 'readonly': False},
'links' : {'type': 'str_list' , 'optional': False , 'readonly': True } }
def get_junction(name: str, id: str) -> dict[str, Any]:

View File

@@ -7,9 +7,9 @@ def get_reservoir_schema(name: str) -> dict[str, dict[str, Any]]:
return { 'id' : {'type': 'str' , 'optional': False , 'readonly': True },
'x' : {'type': 'float' , 'optional': False , 'readonly': False},
'y' : {'type': 'float' , 'optional': False , 'readonly': False},
'head' : {'type': "float" , 'optional': False , 'readonly': False},
'pattern' : {'type': "str" , 'optional': True , 'readonly': False},
'links' : {'type': "str_list" , 'optional': False , 'readonly': True } }
'head' : {'type': 'float' , 'optional': False , 'readonly': False},
'pattern' : {'type': 'str' , 'optional': True , 'readonly': False},
'links' : {'type': 'str_list' , 'optional': False , 'readonly': True } }
def get_reservoir(name: str, id: str) -> dict[str, Any]:

View File

@@ -11,15 +11,15 @@ def get_tank_schema(name: str) -> dict[str, dict[str, Any]]:
return { 'id' : {'type': 'str' , 'optional': False , 'readonly': True },
'x' : {'type': 'float' , 'optional': False , 'readonly': False},
'y' : {'type': 'float' , 'optional': False , 'readonly': False},
'elevation' : {'type': "float" , 'optional': False , 'readonly': False},
'init_level' : {'type': "float" , 'optional': False , 'readonly': False},
'min_level' : {'type': "float" , 'optional': False , 'readonly': False},
'max_level' : {'type': "float" , 'optional': False , 'readonly': False},
'diameter' : {'type': "float" , 'optional': False , 'readonly': False},
'min_vol' : {'type': "float" , 'optional': False , 'readonly': False},
'vol_curve' : {'type': "str" , 'optional': True , 'readonly': False},
'overflow' : {'type': "str" , 'optional': True , 'readonly': False},
'links' : {'type': "str_list" , 'optional': False , 'readonly': True } }
'elevation' : {'type': 'float' , 'optional': False , 'readonly': False},
'init_level' : {'type': 'float' , 'optional': False , 'readonly': False},
'min_level' : {'type': 'float' , 'optional': False , 'readonly': False},
'max_level' : {'type': 'float' , 'optional': False , 'readonly': False},
'diameter' : {'type': 'float' , 'optional': False , 'readonly': False},
'min_vol' : {'type': 'float' , 'optional': False , 'readonly': False},
'vol_curve' : {'type': 'str' , 'optional': True , 'readonly': False},
'overflow' : {'type': 'str' , 'optional': True , 'readonly': False},
'links' : {'type': 'str_list' , 'optional': False , 'readonly': True } }
def get_tank(name: str, id: str) -> dict[str, Any]:

View File

@@ -9,13 +9,13 @@ PIPE_STATUS_CV = 'cv'
def get_pipe_schema(name: str) -> dict[str, dict[str, Any]]:
return { 'id' : {'type': 'str' , 'optional': False , 'readonly': True },
'node1' : {'type': "str" , 'optional': False , 'readonly': False},
'node2' : {'type': "str" , 'optional': False , 'readonly': False},
'length' : {'type': "float" , 'optional': False , 'readonly': False},
'diameter' : {'type': "float" , 'optional': False , 'readonly': False},
'roughness' : {'type': "float" , 'optional': False , 'readonly': False},
'minor_loss' : {'type': "float" , 'optional': False , 'readonly': False},
'status' : {'type': "str" , 'optional': False , 'readonly': False} }
'node1' : {'type': 'str' , 'optional': False , 'readonly': False},
'node2' : {'type': 'str' , 'optional': False , 'readonly': False},
'length' : {'type': 'float' , 'optional': False , 'readonly': False},
'diameter' : {'type': 'float' , 'optional': False , 'readonly': False},
'roughness' : {'type': 'float' , 'optional': False , 'readonly': False},
'minor_loss' : {'type': 'float' , 'optional': False , 'readonly': False},
'status' : {'type': 'str' , 'optional': False , 'readonly': False} }
def get_pipe(name: str, id: str) -> dict[str, Any]:

View File

@@ -4,8 +4,8 @@ from .s0_base import *
def get_pump_schema(name: str) -> dict[str, dict[str, Any]]:
return { 'id' : {'type': 'str' , 'optional': False , 'readonly': True },
'node1' : {'type': "str" , 'optional': False , 'readonly': False},
'node2' : {'type': "str" , 'optional': False , 'readonly': False} }
'node1' : {'type': 'str' , 'optional': False , 'readonly': False},
'node2' : {'type': 'str' , 'optional': False , 'readonly': False} }
def get_pump(name: str, id: str) -> dict[str, Any]:

View File

@@ -12,12 +12,12 @@ VALVES_TYPE_GPV = 'gpv'
def get_valve_schema(name: str) -> dict[str, dict[str, Any]]:
return { 'id' : {'type': 'str' , 'optional': False , 'readonly': True },
'node1' : {'type': "str" , 'optional': False , 'readonly': False},
'node2' : {'type': "str" , 'optional': False , 'readonly': False},
'diameter' : {'type': "float" , 'optional': False , 'readonly': False},
'v_type' : {'type': "str" , 'optional': False , 'readonly': False},
'setting' : {'type': "float" , 'optional': False , 'readonly': False},
'minor_loss' : {'type': "float" , 'optional': False , 'readonly': False} }
'node1' : {'type': 'str' , 'optional': False , 'readonly': False},
'node2' : {'type': 'str' , 'optional': False , 'readonly': False},
'diameter' : {'type': 'float' , 'optional': False , 'readonly': False},
'v_type' : {'type': 'str' , 'optional': False , 'readonly': False},
'setting' : {'type': 'float' , 'optional': False , 'readonly': False},
'minor_loss' : {'type': 'float' , 'optional': False , 'readonly': False} }
def get_valve(name: str, id: str) -> dict[str, Any]: