Skip to content

Commit

Permalink
style: run ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
merydian committed Oct 15, 2024
1 parent 2809327 commit 9165814
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions ORStools/proc/export_proc.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ def processAlgorithm(
"id": "export_request",
}


(sink_line, dest_id_line) = self.parameterAsSink(
parameters,
self.OUT,
Expand All @@ -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"]
Expand All @@ -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])
Expand All @@ -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():
Expand All @@ -178,7 +178,6 @@ def get_fields_point():

return fields


def displayName(self) -> str:
"""
Algorithm name shown in QGIS toolbox
Expand Down

0 comments on commit 9165814

Please sign in to comment.