Skip to content

Commit 5a56592

Browse files
committed
style: run ruff
1 parent 7d442e1 commit 5a56592

9 files changed

+81
-27
lines changed

ORStools/proc/base_processing_algorithm.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
* *
2727
***************************************************************************/
2828
"""
29+
2930
from PyQt5.QtCore import QCoreApplication, QSettings
3031
from qgis.core import (
3132
QgsProcessing,
@@ -188,10 +189,18 @@ def option_parameters(self) -> [QgsProcessingParameterDefinition]:
188189
),
189190
]
190191

191-
self.setToolTip(parameters[0], self.tr("Select features that should be avoided by the algorithm."))
192-
self.setToolTip(parameters[1], self.tr("Select borders that should be avoided by the algorithm."))
193-
self.setToolTip(parameters[2], self.tr("Select countries that should be avoided by the algorithm."))
194-
self.setToolTip(parameters[3], self.tr("Select polygons that should be avoided by the algorithm."))
192+
self.setToolTip(
193+
parameters[0], self.tr("Select features that should be avoided by the algorithm.")
194+
)
195+
self.setToolTip(
196+
parameters[1], self.tr("Select borders that should be avoided by the algorithm.")
197+
)
198+
self.setToolTip(
199+
parameters[2], self.tr("Select countries that should be avoided by the algorithm.")
200+
)
201+
self.setToolTip(
202+
parameters[3], self.tr("Select polygons that should be avoided by the algorithm.")
203+
)
195204

196205
return parameters
197206

ORStools/proc/directions_lines_proc.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,19 @@ def __init__(self):
8787
self.setToolTip(self.PARAMETERS[0], "LineString or MultiLineString layer.")
8888
self.setToolTip(
8989
self.PARAMETERS[1],
90-
self.tr("Values will transfer to the output layer and can be used to join layers or group features afterwards."),
90+
self.tr(
91+
"Values will transfer to the output layer and can be used to join layers or group features afterwards."
92+
),
9193
)
9294
self.setToolTip(
93-
self.PARAMETERS[2], self.tr("Dictates the cost. For longer routes don't use Shortest Path.")
95+
self.PARAMETERS[2],
96+
self.tr("Dictates the cost. For longer routes don't use Shortest Path."),
9497
)
9598
self.setToolTip(
9699
self.PARAMETERS[3],
97-
self.tr("You can optionally perform a Traveling Salesman on the waypoints of each MultiPoint feature. Enabling Traveling Salesman will erase all other advanced configuration and assume the preference to be fastest Advanced Parameters: see the documentation for descriptions."),
100+
self.tr(
101+
"You can optionally perform a Traveling Salesman on the waypoints of each MultiPoint feature. Enabling Traveling Salesman will erase all other advanced configuration and assume the preference to be fastest Advanced Parameters: see the documentation for descriptions."
102+
),
98103
)
99104

100105
def processAlgorithm(self, parameters, context, feedback):

ORStools/proc/directions_points_layer_proc.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,18 +95,25 @@ def __init__(self):
9595
self.setToolTip(self.PARAMETERS[0], self.tr("Point or MultiPoint layer."))
9696
self.setToolTip(
9797
self.PARAMETERS[1],
98-
self.tr("Values will transfer to the output layer and can be used to join layers or group features afterwards."),
98+
self.tr(
99+
"Values will transfer to the output layer and can be used to join layers or group features afterwards."
100+
),
99101
)
100102
self.setToolTip(
101103
self.PARAMETERS[2],
102-
self.tr("Before running the algorithm points are sorted by the values of this field (Be aware of the field type! Text fields will be sorted like 1,13,2,D,a,x)."),
104+
self.tr(
105+
"Before running the algorithm points are sorted by the values of this field (Be aware of the field type! Text fields will be sorted like 1,13,2,D,a,x)."
106+
),
103107
)
104108
self.setToolTip(
105-
self.PARAMETERS[3], self.tr("Dictates the cost. For longer routes don't use Shortest Path.")
109+
self.PARAMETERS[3],
110+
self.tr("Dictates the cost. For longer routes don't use Shortest Path."),
106111
)
107112
self.setToolTip(
108113
self.PARAMETERS[4],
109-
self.tr("You can optionally perform a Traveling Salesman Optimization on the waypoints of each (Multi)Point feature. Enabling Traveling Salesman will erase all other advanced configuration and assume the preference to be fastest."),
114+
self.tr(
115+
"You can optionally perform a Traveling Salesman Optimization on the waypoints of each (Multi)Point feature. Enabling Traveling Salesman will erase all other advanced configuration and assume the preference to be fastest."
116+
),
110117
)
111118

112119
def processAlgorithm(self, parameters, context, feedback):

ORStools/proc/directions_points_layers_proc.py

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -108,30 +108,43 @@ def __init__(self):
108108
defaultValue=self.MODE_SELECTION[0],
109109
),
110110
]
111-
self.setToolTip(self.PARAMETERS[0], self.tr("Only Point layers are allowed, not MultiPoint."))
111+
self.setToolTip(
112+
self.PARAMETERS[0], self.tr("Only Point layers are allowed, not MultiPoint.")
113+
)
112114
self.setToolTip(
113115
self.PARAMETERS[1],
114-
self.tr("Values will transfer to the output layer and can be used to join layers or group features afterwards."),
116+
self.tr(
117+
"Values will transfer to the output layer and can be used to join layers or group features afterwards."
118+
),
115119
)
116120
self.setToolTip(
117121
self.PARAMETERS[2],
118-
self.tr("Before running the algorithm points are sorted by the values of this field (Be aware of the field type! Text fields will be sorted like 1,13,2,D,a,x)"),
122+
self.tr(
123+
"Before running the algorithm points are sorted by the values of this field (Be aware of the field type! Text fields will be sorted like 1,13,2,D,a,x)"
124+
),
119125
)
120126
self.setToolTip(self.PARAMETERS[3], "Only Point layers are allowed, not MultiPoint.")
121127
self.setToolTip(
122128
self.PARAMETERS[4],
123-
self.tr("Values will transfer to the output layer and can be used to join layers or group features afterwards."),
129+
self.tr(
130+
"Values will transfer to the output layer and can be used to join layers or group features afterwards."
131+
),
124132
)
125133
self.setToolTip(
126134
self.PARAMETERS[5],
127-
self.tr("Before running the algorithm points are sorted by the values of this field (Be aware of the field type! Text fields will be sorted like 1,13,2,D,a,x)"),
135+
self.tr(
136+
"Before running the algorithm points are sorted by the values of this field (Be aware of the field type! Text fields will be sorted like 1,13,2,D,a,x)"
137+
),
128138
)
129139
self.setToolTip(
130-
self.PARAMETERS[6], self.tr("Dictates the cost. For longer routes don't use Shortest Path.")
140+
self.PARAMETERS[6],
141+
self.tr("Dictates the cost. For longer routes don't use Shortest Path."),
131142
)
132143
self.setToolTip(
133144
self.PARAMETERS[7],
134-
self.tr("Either 'row-by-row' until one layers has no more features or 'all-by-all' for every feature combination"),
145+
self.tr(
146+
"Either 'row-by-row' until one layers has no more features or 'all-by-all' for every feature combination"
147+
),
135148
)
136149

137150
# TODO: preprocess parameters to options the range cleanup below:

ORStools/proc/isochrones_layer_proc.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,18 +104,26 @@ def __init__(self):
104104
),
105105
]
106106

107-
self.setToolTip(self.PARAMETERS[0], self.tr("Only Point layers are allowed, not MultiPoint."))
107+
self.setToolTip(
108+
self.PARAMETERS[0], self.tr("Only Point layers are allowed, not MultiPoint.")
109+
)
108110
self.setToolTip(
109111
self.PARAMETERS[1],
110-
self.tr("Values will transfer to the output layer and can be used to join layers or group features afterwards."),
112+
self.tr(
113+
"Values will transfer to the output layer and can be used to join layers or group features afterwards."
114+
),
111115
)
112116
self.setToolTip(
113117
self.PARAMETERS[3],
114-
self.tr("Parameter needs to be a comma-separated list of integer values, no decimal points."),
118+
self.tr(
119+
"Parameter needs to be a comma-separated list of integer values, no decimal points."
120+
),
115121
)
116122
self.setToolTip(
117123
self.PARAMETERS[4],
118-
self.tr("Applies a level of generalisation to the isochrone polygons generated as a smoothing_factor between 0 and 100."),
124+
self.tr(
125+
"Applies a level of generalisation to the isochrone polygons generated as a smoothing_factor between 0 and 100."
126+
),
119127
)
120128
self.setToolTip(
121129
self.PARAMETERS[5],

ORStools/proc/isochrones_point_proc.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,15 @@ def __init__(self):
9393
self.setToolTip(self.PARAMETERS[0], self.tr("Choose a Point from the map."))
9494
self.setToolTip(
9595
self.PARAMETERS[2],
96-
self.tr("Parameter needs to be a comma-separated list of integer values, no decimal points."),
96+
self.tr(
97+
"Parameter needs to be a comma-separated list of integer values, no decimal points."
98+
),
9799
)
98100
self.setToolTip(
99101
self.PARAMETERS[3],
100-
self.tr("Applies a level of generalisation to the isochrone polygons generated as a smoothing_factor between 0 and 100."),
102+
self.tr(
103+
"Applies a level of generalisation to the isochrone polygons generated as a smoothing_factor between 0 and 100."
104+
),
101105
)
102106
self.setToolTip(
103107
self.PARAMETERS[4],

ORStools/proc/matrix_proc.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,21 @@ def __init__(self):
8282
),
8383
]
8484

85-
self.setToolTip(self.PARAMETERS[0], self.tr("Only Point layers are allowed, not MultiPoint."))
85+
self.setToolTip(
86+
self.PARAMETERS[0], self.tr("Only Point layers are allowed, not MultiPoint.")
87+
)
8688
self.setToolTip(
8789
self.PARAMETERS[1],
88-
self.tr("Values will transfer to the output layer and can be used to join layers or group features afterwards."),
90+
self.tr(
91+
"Values will transfer to the output layer and can be used to join layers or group features afterwards."
92+
),
8993
)
9094
self.setToolTip(self.PARAMETERS[2], "Only Point layers are allowed, not MultiPoint.")
9195
self.setToolTip(
9296
self.PARAMETERS[3],
93-
self.tr("Values will transfer to the output layer and can be used to join layers or group features afterwards."),
97+
self.tr(
98+
"Values will transfer to the output layer and can be used to join layers or group features afterwards."
99+
),
94100
)
95101

96102
def processAlgorithm(self, parameters, context, feedback):

ORStools/utils/configmanager.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
* *
2727
***************************************************************************/
2828
"""
29+
2930
import os
3031

3132
import yaml

ORStools/utils/processing.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
* *
2727
***************************************************************************/
2828
"""
29+
2930
import os
3031
from qgis.core import QgsPointXY
3132

0 commit comments

Comments
 (0)