From 1b3df02fcb0aa3ff43e800e43878c5ff21adc5fe Mon Sep 17 00:00:00 2001 From: Trishna Saeharaseelan <trishna.saeharaseelan@noc.ac.uk> Date: Mon, 5 Jun 2023 17:07:01 +0100 Subject: [PATCH] fix: lint --- formats/survey.py | 34 ++++++++++++++++++++++++---------- formats/survey_encoded.py | 8 ++------ generate_schema_config.py | 3 +-- 3 files changed, 27 insertions(+), 18 deletions(-) diff --git a/formats/survey.py b/formats/survey.py index f5f928c..c73dcd2 100644 --- a/formats/survey.py +++ b/formats/survey.py @@ -15,41 +15,55 @@ survey_schema = { "latitude_A": { "type": "number", "format": "float", - "description": ("Latitude of point A(intersection of normal)" - + "from waypoint A to survey line"), + "description": ( + "Latitude of point A(intersection of normal)" + + "from waypoint A to survey line" + ), "example": 178.2, }, "longitude_A": { "type": "number", "format": "float", - "description": ("Longitude of point A(intersection of normal)" - + "from waypoint A to survey line"), + "description": ( + "Longitude of point A(intersection of normal)" + + "from waypoint A to survey line" + ), "example": -10.122, }, "latitude_B": { "type": "number", "format": "float", - "description": ("Latitude of point B(intersection of normal)" - + "from waypoint B to survey line"), + "description": ( + "Latitude of point B(intersection of normal)" + + "from waypoint B to survey line" + ), "example": 178.2, }, "longitude_B": { "type": "number", "format": "float", - "description": ("Longitude of point B(intersection of normal)" - + "from waypoint B to survey line"), + "description": ( + "Longitude of point B(intersection of normal)" + + "from waypoint B to survey line" + ), "example": -10.122, }, "platform_ID": { "type": "string", "description": "Unique identifier for this platform", "example": "ecosub-2", - }, + }, "track_ID": { "type": "integer", "description": "Track number of action(s) currently executed by platform", "example": 1, }, }, - "required": ["latitude_A", "longitude_A", "latitude_B", "longitude_B", "platform_ID"], + "required": [ + "latitude_A", + "longitude_A", + "latitude_B", + "longitude_B", + "platform_ID", + ], } diff --git a/formats/survey_encoded.py b/formats/survey_encoded.py index 88081e3..218c8cf 100644 --- a/formats/survey_encoded.py +++ b/formats/survey_encoded.py @@ -7,9 +7,5 @@ from copy import deepcopy survey_encoded_schema = deepcopy(encoded_schema) -survey_encoded_schema["properties"]["message_type"]["enum"] = [ - "survey_encoded" -] -survey_encoded_schema["properties"]["message_type"][ - "example" -] = "survey_encoded" +survey_encoded_schema["properties"]["message_type"]["enum"] = ["survey_encoded"] +survey_encoded_schema["properties"]["message_type"]["example"] = "survey_encoded" diff --git a/generate_schema_config.py b/generate_schema_config.py index 2204b14..bc08138 100644 --- a/generate_schema_config.py +++ b/generate_schema_config.py @@ -68,8 +68,7 @@ swagger_config = { + "platform_status_encoded", "acknowledgement": "#/components/schemas/acknowledgement", "survey": "#/components/schemas/survey", - "survey_encoded": "#/components/schemas/" - + "survey_encoded", + "survey_encoded": "#/components/schemas/" + "survey_encoded", }, }, "oneOf": [ -- GitLab