From 91658144e0370aeadf7131a40a5546b972043b7a Mon Sep 17 00:00:00 2001 From: merydian Date: Tue, 15 Oct 2024 13:48:04 +0200 Subject: [PATCH] style: run ruff --- ORStools/proc/export_proc.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/ORStools/proc/export_proc.py b/ORStools/proc/export_proc.py index ab99c82..048fc70 100644 --- a/ORStools/proc/export_proc.py +++ b/ORStools/proc/export_proc.py @@ -99,7 +99,6 @@ def processAlgorithm( "id": "export_request", } - (sink_line, dest_id_line) = self.parameterAsSink( parameters, self.OUT, @@ -121,7 +120,7 @@ def processAlgorithm( # Make request and catch ApiError try: response = ors_client.request("/v2/export/" + profile, {}, post_json=params) - nodes_dict = {item['nodeId']: item['location'] for item in response["nodes"]} + nodes_dict = {item["nodeId"]: item["location"] for item in response["nodes"]} edges = response["edges"] for edge in edges: from_id = edge["fromId"] @@ -143,7 +142,9 @@ def processAlgorithm( feat.setAttributes([from_id, to_id, weight]) sink_line.addFeature(feat) - unique_coordinates = {tuple(item['location']): item['nodeId'] for item in response["nodes"]} + unique_coordinates = { + tuple(item["location"]): item["nodeId"] for item in response["nodes"] + } points = [(coords, node_id) for coords, node_id in unique_coordinates.items()] for item in points: point = QgsPointXY(item[0][0], item[0][1]) @@ -159,8 +160,7 @@ def processAlgorithm( feedback.reportError(msg) logger.log(msg) - return {self.OUT: dest_id_line, - self.OUT_POINT: dest_id_point} + return {self.OUT: dest_id_line, self.OUT_POINT: dest_id_point} @staticmethod def get_fields_line(): @@ -178,7 +178,6 @@ def get_fields_point(): return fields - def displayName(self) -> str: """ Algorithm name shown in QGIS toolbox