From a48c21f49b6d9575fa4343e249a2ef70ec94ed3b Mon Sep 17 00:00:00 2001 From: "WQY\\qiong" Date: Fri, 21 Oct 2022 20:31:06 +0800 Subject: [PATCH] Format schema --- api/s2_junctions.py | 8 ++++---- api/s3_reservoirs.py | 6 +++--- api/s4_tanks.py | 18 +++++++++--------- api/s5_pipes.py | 14 +++++++------- api/s6_pumps.py | 4 ++-- api/s7_valves.py | 12 ++++++------ 6 files changed, 31 insertions(+), 31 deletions(-) diff --git a/api/s2_junctions.py b/api/s2_junctions.py index 0761ae6..0fe5e87 100644 --- a/api/s2_junctions.py +++ b/api/s2_junctions.py @@ -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]: diff --git a/api/s3_reservoirs.py b/api/s3_reservoirs.py index 42452a7..76a1618 100644 --- a/api/s3_reservoirs.py +++ b/api/s3_reservoirs.py @@ -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]: diff --git a/api/s4_tanks.py b/api/s4_tanks.py index 2a5a7cc..d7cdff7 100644 --- a/api/s4_tanks.py +++ b/api/s4_tanks.py @@ -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]: diff --git a/api/s5_pipes.py b/api/s5_pipes.py index 5e008b4..d8f1e3e 100644 --- a/api/s5_pipes.py +++ b/api/s5_pipes.py @@ -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]: diff --git a/api/s6_pumps.py b/api/s6_pumps.py index 715fc93..1cbdae7 100644 --- a/api/s6_pumps.py +++ b/api/s6_pumps.py @@ -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]: diff --git a/api/s7_valves.py b/api/s7_valves.py index c08a76b..d3f95b2 100644 --- a/api/s7_valves.py +++ b/api/s7_valves.py @@ -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]: