From 6c919ebfd31051432ffffc114c9d8b3e5bb07d30 Mon Sep 17 00:00:00 2001 From: Merydian Date: Mon, 12 Feb 2024 14:13:18 +0100 Subject: [PATCH 01/13] feat: overwrite tooltip method --- ORStools/proc/base_processing_algorithm.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ORStools/proc/base_processing_algorithm.py b/ORStools/proc/base_processing_algorithm.py index 206bc347..078f5d9d 100644 --- a/ORStools/proc/base_processing_algorithm.py +++ b/ORStools/proc/base_processing_algorithm.py @@ -245,3 +245,7 @@ def initAlgorithm(self, configuration): def tr(self, string, context=None): context = context or self.__class__.__name__ return QCoreApplication.translate(context, string) + + def setToolTip(self, parameter, text): + basic = parameter.toolTip() + parameter.toolTip = lambda: f'{basic}\n{text}' From 75d86d46613d1c3d746d84b4f7664a30f2c69da7 Mon Sep 17 00:00:00 2001 From: Merydian Date: Mon, 12 Feb 2024 14:17:48 +0100 Subject: [PATCH 02/13] docs: add tooltip descriptions for directions_points_layer_proc --- ORStools/proc/directions_points_layer_proc.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ORStools/proc/directions_points_layer_proc.py b/ORStools/proc/directions_points_layer_proc.py index 46ed384e..a4070c1a 100644 --- a/ORStools/proc/directions_points_layer_proc.py +++ b/ORStools/proc/directions_points_layer_proc.py @@ -92,6 +92,12 @@ def __init__(self): ), ] + self.setToolTip(self.PARAMETERS[0], "Point or MultiPoint layer.") + self.setToolTip(self.PARAMETERS[1], "Values will transfer to the output layer and can be used to join layers or group features afterwards") + self.setToolTip(self.PARAMETERS[2], "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)") + self.setToolTip(self.PARAMETERS[3], "Dictates the cost. For longer routes don't use Shortest Path.") + self.setToolTip(self.PARAMETERS[4], "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") + def processAlgorithm(self, parameters, context, feedback): ors_client = self._get_ors_client_from_provider(parameters[self.IN_PROVIDER], feedback) From d9c3630fd66453bb20e3111f6b85010608fd005f Mon Sep 17 00:00:00 2001 From: Merydian Date: Mon, 12 Feb 2024 14:22:17 +0100 Subject: [PATCH 03/13] docs add tooltip descriptions for directions_from_polylines_layer --- ORStools/proc/directions_lines_proc.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ORStools/proc/directions_lines_proc.py b/ORStools/proc/directions_lines_proc.py index 29e018b8..7e32f2ca 100644 --- a/ORStools/proc/directions_lines_proc.py +++ b/ORStools/proc/directions_lines_proc.py @@ -84,6 +84,11 @@ def __init__(self): ), ] + self.setToolTip(self.PARAMETERS[0], "LineString or MultiLineString layer.") + self.setToolTip(self.PARAMETERS[1], "Values will transfer to the output layer and can be used to join layers or group features afterwards.") + self.setToolTip(self.PARAMETERS[2], "Dictates the cost. For longer routes don't use Shortest Path.") + self.setToolTip(self.PARAMETERS[3], "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.") + def processAlgorithm(self, parameters, context, feedback): ors_client = self._get_ors_client_from_provider(parameters[self.IN_PROVIDER], feedback) From de6f34e751fee27b0667ea49e13724ad133fab7a Mon Sep 17 00:00:00 2001 From: Merydian Date: Mon, 12 Feb 2024 14:27:49 +0100 Subject: [PATCH 04/13] docs add tooltip descriptions for directions_from_points_2_layers --- ORStools/proc/directions_points_layers_proc.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ORStools/proc/directions_points_layers_proc.py b/ORStools/proc/directions_points_layers_proc.py index b7e00379..7f374704 100644 --- a/ORStools/proc/directions_points_layers_proc.py +++ b/ORStools/proc/directions_points_layers_proc.py @@ -108,6 +108,14 @@ def __init__(self): defaultValue=self.MODE_SELECTION[0], ), ] + self.setToolTip(self.PARAMETERS[0], "Only Point layers are allowed, not MultiPoint.") + self.setToolTip(self.PARAMETERS[1], "Values will transfer to the output layer and can be used to join layers or group features afterwards.") + self.setToolTip(self.PARAMETERS[2], "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)") + self.setToolTip(self.PARAMETERS[3], "Only Point layers are allowed, not MultiPoint.") + self.setToolTip(self.PARAMETERS[4], "Values will transfer to the output layer and can be used to join layers or group features afterwards.") + self.setToolTip(self.PARAMETERS[5], "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)") + self.setToolTip(self.PARAMETERS[6], "Dictates the cost. For longer routes don't use Shortest Path.") + self.setToolTip(self.PARAMETERS[7], "Either 'row-by-row' until one layers has no more features or 'all-by-all' for every feature combination") # TODO: preprocess parameters to options the range cleanup below: # https://www.qgis.org/pyqgis/master/core/Processing/QgsProcessingAlgorithm.html#qgis.core.QgsProcessingAlgorithm.preprocessParameters From 55feaa1509af6e42b17392cb85b1c61341a21083 Mon Sep 17 00:00:00 2001 From: Merydian Date: Mon, 12 Feb 2024 14:34:36 +0100 Subject: [PATCH 05/13] docs: add tooltip descriptions for isochrones_from_layer --- ORStools/proc/isochrones_layer_proc.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ORStools/proc/isochrones_layer_proc.py b/ORStools/proc/isochrones_layer_proc.py index f0582f33..bfd58921 100644 --- a/ORStools/proc/isochrones_layer_proc.py +++ b/ORStools/proc/isochrones_layer_proc.py @@ -104,6 +104,12 @@ def __init__(self): ), ] + self.setToolTip(self.PARAMETERS[0], "Only Point layers are allowed, not MultiPoint.") + self.setToolTip(self.PARAMETERS[1], "Values will transfer to the output layer and can be used to join layers or group features afterwards.") + self.setToolTip(self.PARAMETERS[3], "Parameter needs to be a comma-separated list of integer values, no decimal points.") + self.setToolTip(self.PARAMETERS[4], "Applies a level of generalisation to the isochrone polygons generated as a smoothing_factor between 0 and 100") + self.setToolTip(self.PARAMETERS[5], "Start treats the location(s) as starting point, destination as goal.") + # Save some important references # TODO bad style, refactor isochrones = isochrones_core.Isochrones() From 7a1ff889d376a85c364f07ecebbfb84626dbdefa Mon Sep 17 00:00:00 2001 From: Merydian Date: Mon, 12 Feb 2024 14:39:44 +0100 Subject: [PATCH 06/13] docs: add tooltip descriptions for isochrones_from_point --- ORStools/proc/isochrones_point_proc.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ORStools/proc/isochrones_point_proc.py b/ORStools/proc/isochrones_point_proc.py index 1eb30ddc..f35b29e3 100644 --- a/ORStools/proc/isochrones_point_proc.py +++ b/ORStools/proc/isochrones_point_proc.py @@ -90,6 +90,11 @@ def __init__(self): ), ] + self.setToolTip(self.PARAMETERS[0], "Choose a Point from the map") + self.setToolTip(self.PARAMETERS[2], "Parameter needs to be a comma-separated list of integer values, no decimal points.") + self.setToolTip(self.PARAMETERS[3], "Applies a level of generalisation to the isochrone polygons generated as a smoothing_factor between 0 and 100") + self.setToolTip(self.PARAMETERS[4], "Start treats the location(s) as starting point, destination as goal.") + # Save some important references # TODO bad style, refactor isochrones = isochrones_core.Isochrones() From a4935ef86d9a20933bf7bd16e1257d68313e3a5c Mon Sep 17 00:00:00 2001 From: Merydian Date: Mon, 12 Feb 2024 14:44:38 +0100 Subject: [PATCH 07/13] feat: add tootltip description for matrix_from_layers --- ORStools/proc/matrix_proc.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ORStools/proc/matrix_proc.py b/ORStools/proc/matrix_proc.py index 5a365fb2..f6ac968b 100644 --- a/ORStools/proc/matrix_proc.py +++ b/ORStools/proc/matrix_proc.py @@ -82,6 +82,11 @@ def __init__(self): ), ] + self.setToolTip(self.PARAMETERS[0], "Only Point layers are allowed, not MultiPoint.") + self.setToolTip(self.PARAMETERS[1], "Values will transfer to the output layer and can be used to join layers or group features afterwards.") + self.setToolTip(self.PARAMETERS[2], "Only Point layers are allowed, not MultiPoint.") + self.setToolTip(self.PARAMETERS[3], "Values will transfer to the output layer and can be used to join layers or group features afterwards.") + def processAlgorithm(self, parameters, context, feedback): ors_client = self._get_ors_client_from_provider(parameters[self.IN_PROVIDER], feedback) From aac714e0795322f418ada65e87c01b457db357b9 Mon Sep 17 00:00:00 2001 From: Merydian Date: Mon, 12 Feb 2024 14:58:20 +0100 Subject: [PATCH 08/13] docs: add tooltips descriptions for base_processing_algorithm --- ORStools/proc/base_processing_algorithm.py | 26 ++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/ORStools/proc/base_processing_algorithm.py b/ORStools/proc/base_processing_algorithm.py index 078f5d9d..f67d7684 100644 --- a/ORStools/proc/base_processing_algorithm.py +++ b/ORStools/proc/base_processing_algorithm.py @@ -116,35 +116,46 @@ def provider_parameter(self) -> QgsProcessingParameterEnum: Parameter definition for provider, used in all child classes """ providers = [provider["name"] for provider in configmanager.read_config()["providers"]] - return QgsProcessingParameterEnum( + parameter = QgsProcessingParameterEnum( self.IN_PROVIDER, self.tr("Provider", "ORSBaseProcessingAlgorithm"), providers, defaultValue=providers[0], ) + self.setToolTip(parameter, "Select the provider that should be used.") + + return parameter + def profile_parameter(self) -> QgsProcessingParameterEnum: """ Parameter definition for profile, used in all child classes """ - return QgsProcessingParameterEnum( + parameter = QgsProcessingParameterEnum( self.IN_PROFILE, self.tr("Travel mode", "ORSBaseProcessingAlgorithm"), PROFILES, defaultValue=PROFILES[0], ) + self.setToolTip(parameter, "Select a mode of travel.") + + return parameter + def output_parameter(self) -> QgsProcessingParameterFeatureSink: """ Parameter definition for output, used in all child classes """ - return QgsProcessingParameterFeatureSink( + parameter = QgsProcessingParameterFeatureSink( name=self.OUT, description=self.GROUP, ) + self.setToolTip(parameter, "Select where the output should be saved.") + + return parameter def option_parameters(self) -> [QgsProcessingParameterDefinition]: - return [ + parameters = [ QgsProcessingParameterEnum( self.IN_AVOID_FEATS, self.tr("Features to avoid", "ORSBaseProcessingAlgorithm"), @@ -177,6 +188,13 @@ def option_parameters(self) -> [QgsProcessingParameterDefinition]: ), ] + self.setToolTip(parameters[0], "Select features that should be avoided by the algorithm") + self.setToolTip(parameters[1], "Select borders that should be avoided by the algorithm") + self.setToolTip(parameters[2], "Select countries that should be avoided by the algorithm") + self.setToolTip(parameters[3], "Select polygons that should be avoided by the algorithm") + + return parameters + @classmethod def _get_ors_client_from_provider( cls, provider: str, feedback: QgsProcessingFeedback From 953d86448c4b4037e4b2a0e37fbb8e0f025a002d Mon Sep 17 00:00:00 2001 From: Merydian Date: Mon, 12 Feb 2024 14:59:35 +0100 Subject: [PATCH 09/13] style: correct punctuation --- ORStools/proc/base_processing_algorithm.py | 8 ++++---- ORStools/proc/directions_points_layer_proc.py | 6 +++--- ORStools/proc/isochrones_layer_proc.py | 2 +- ORStools/proc/isochrones_point_proc.py | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ORStools/proc/base_processing_algorithm.py b/ORStools/proc/base_processing_algorithm.py index f67d7684..3fed6edd 100644 --- a/ORStools/proc/base_processing_algorithm.py +++ b/ORStools/proc/base_processing_algorithm.py @@ -188,10 +188,10 @@ def option_parameters(self) -> [QgsProcessingParameterDefinition]: ), ] - self.setToolTip(parameters[0], "Select features that should be avoided by the algorithm") - self.setToolTip(parameters[1], "Select borders that should be avoided by the algorithm") - self.setToolTip(parameters[2], "Select countries that should be avoided by the algorithm") - self.setToolTip(parameters[3], "Select polygons that should be avoided by the algorithm") + self.setToolTip(parameters[0], "Select features that should be avoided by the algorithm.") + self.setToolTip(parameters[1], "Select borders that should be avoided by the algorithm.") + self.setToolTip(parameters[2], "Select countries that should be avoided by the algorithm.") + self.setToolTip(parameters[3], "Select polygons that should be avoided by the algorithm.") return parameters diff --git a/ORStools/proc/directions_points_layer_proc.py b/ORStools/proc/directions_points_layer_proc.py index a4070c1a..2d03d9e9 100644 --- a/ORStools/proc/directions_points_layer_proc.py +++ b/ORStools/proc/directions_points_layer_proc.py @@ -93,10 +93,10 @@ def __init__(self): ] self.setToolTip(self.PARAMETERS[0], "Point or MultiPoint layer.") - self.setToolTip(self.PARAMETERS[1], "Values will transfer to the output layer and can be used to join layers or group features afterwards") - self.setToolTip(self.PARAMETERS[2], "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)") + self.setToolTip(self.PARAMETERS[1], "Values will transfer to the output layer and can be used to join layers or group features afterwards.") + self.setToolTip(self.PARAMETERS[2], "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).") self.setToolTip(self.PARAMETERS[3], "Dictates the cost. For longer routes don't use Shortest Path.") - self.setToolTip(self.PARAMETERS[4], "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") + self.setToolTip(self.PARAMETERS[4], "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.") def processAlgorithm(self, parameters, context, feedback): ors_client = self._get_ors_client_from_provider(parameters[self.IN_PROVIDER], feedback) diff --git a/ORStools/proc/isochrones_layer_proc.py b/ORStools/proc/isochrones_layer_proc.py index bfd58921..7cc81c5a 100644 --- a/ORStools/proc/isochrones_layer_proc.py +++ b/ORStools/proc/isochrones_layer_proc.py @@ -107,7 +107,7 @@ def __init__(self): self.setToolTip(self.PARAMETERS[0], "Only Point layers are allowed, not MultiPoint.") self.setToolTip(self.PARAMETERS[1], "Values will transfer to the output layer and can be used to join layers or group features afterwards.") self.setToolTip(self.PARAMETERS[3], "Parameter needs to be a comma-separated list of integer values, no decimal points.") - self.setToolTip(self.PARAMETERS[4], "Applies a level of generalisation to the isochrone polygons generated as a smoothing_factor between 0 and 100") + self.setToolTip(self.PARAMETERS[4], "Applies a level of generalisation to the isochrone polygons generated as a smoothing_factor between 0 and 100.") self.setToolTip(self.PARAMETERS[5], "Start treats the location(s) as starting point, destination as goal.") # Save some important references diff --git a/ORStools/proc/isochrones_point_proc.py b/ORStools/proc/isochrones_point_proc.py index f35b29e3..fb95b476 100644 --- a/ORStools/proc/isochrones_point_proc.py +++ b/ORStools/proc/isochrones_point_proc.py @@ -90,9 +90,9 @@ def __init__(self): ), ] - self.setToolTip(self.PARAMETERS[0], "Choose a Point from the map") + self.setToolTip(self.PARAMETERS[0], "Choose a Point from the map.") self.setToolTip(self.PARAMETERS[2], "Parameter needs to be a comma-separated list of integer values, no decimal points.") - self.setToolTip(self.PARAMETERS[3], "Applies a level of generalisation to the isochrone polygons generated as a smoothing_factor between 0 and 100") + self.setToolTip(self.PARAMETERS[3], "Applies a level of generalisation to the isochrone polygons generated as a smoothing_factor between 0 and 100.") self.setToolTip(self.PARAMETERS[4], "Start treats the location(s) as starting point, destination as goal.") # Save some important references From d53bee580268b3a2173a3436819cf7cc8e332c6b Mon Sep 17 00:00:00 2001 From: Merydian Date: Mon, 12 Feb 2024 15:00:36 +0100 Subject: [PATCH 10/13] style: run ruff --- ORStools/proc/base_processing_algorithm.py | 4 +-- ORStools/proc/directions_lines_proc.py | 14 +++++++-- ORStools/proc/directions_points_layer_proc.py | 19 +++++++++--- .../proc/directions_points_layers_proc.py | 29 +++++++++++++++---- ORStools/proc/isochrones_layer_proc.py | 20 ++++++++++--- ORStools/proc/isochrones_point_proc.py | 15 ++++++++-- ORStools/proc/matrix_proc.py | 10 +++++-- 7 files changed, 87 insertions(+), 24 deletions(-) diff --git a/ORStools/proc/base_processing_algorithm.py b/ORStools/proc/base_processing_algorithm.py index 3fed6edd..b6d40c5c 100644 --- a/ORStools/proc/base_processing_algorithm.py +++ b/ORStools/proc/base_processing_algorithm.py @@ -131,7 +131,7 @@ def profile_parameter(self) -> QgsProcessingParameterEnum: """ Parameter definition for profile, used in all child classes """ - parameter = QgsProcessingParameterEnum( + parameter = QgsProcessingParameterEnum( self.IN_PROFILE, self.tr("Travel mode", "ORSBaseProcessingAlgorithm"), PROFILES, @@ -266,4 +266,4 @@ def tr(self, string, context=None): def setToolTip(self, parameter, text): basic = parameter.toolTip() - parameter.toolTip = lambda: f'{basic}\n{text}' + parameter.toolTip = lambda: f"{basic}\n{text}" diff --git a/ORStools/proc/directions_lines_proc.py b/ORStools/proc/directions_lines_proc.py index 7e32f2ca..6596a51b 100644 --- a/ORStools/proc/directions_lines_proc.py +++ b/ORStools/proc/directions_lines_proc.py @@ -85,9 +85,17 @@ def __init__(self): ] self.setToolTip(self.PARAMETERS[0], "LineString or MultiLineString layer.") - self.setToolTip(self.PARAMETERS[1], "Values will transfer to the output layer and can be used to join layers or group features afterwards.") - self.setToolTip(self.PARAMETERS[2], "Dictates the cost. For longer routes don't use Shortest Path.") - self.setToolTip(self.PARAMETERS[3], "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.") + self.setToolTip( + self.PARAMETERS[1], + "Values will transfer to the output layer and can be used to join layers or group features afterwards.", + ) + self.setToolTip( + self.PARAMETERS[2], "Dictates the cost. For longer routes don't use Shortest Path." + ) + self.setToolTip( + self.PARAMETERS[3], + "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.", + ) def processAlgorithm(self, parameters, context, feedback): ors_client = self._get_ors_client_from_provider(parameters[self.IN_PROVIDER], feedback) diff --git a/ORStools/proc/directions_points_layer_proc.py b/ORStools/proc/directions_points_layer_proc.py index 2d03d9e9..68672786 100644 --- a/ORStools/proc/directions_points_layer_proc.py +++ b/ORStools/proc/directions_points_layer_proc.py @@ -93,10 +93,21 @@ def __init__(self): ] self.setToolTip(self.PARAMETERS[0], "Point or MultiPoint layer.") - self.setToolTip(self.PARAMETERS[1], "Values will transfer to the output layer and can be used to join layers or group features afterwards.") - self.setToolTip(self.PARAMETERS[2], "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).") - self.setToolTip(self.PARAMETERS[3], "Dictates the cost. For longer routes don't use Shortest Path.") - self.setToolTip(self.PARAMETERS[4], "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.") + self.setToolTip( + self.PARAMETERS[1], + "Values will transfer to the output layer and can be used to join layers or group features afterwards.", + ) + self.setToolTip( + self.PARAMETERS[2], + "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).", + ) + self.setToolTip( + self.PARAMETERS[3], "Dictates the cost. For longer routes don't use Shortest Path." + ) + self.setToolTip( + self.PARAMETERS[4], + "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.", + ) def processAlgorithm(self, parameters, context, feedback): ors_client = self._get_ors_client_from_provider(parameters[self.IN_PROVIDER], feedback) diff --git a/ORStools/proc/directions_points_layers_proc.py b/ORStools/proc/directions_points_layers_proc.py index 7f374704..b9fb6af2 100644 --- a/ORStools/proc/directions_points_layers_proc.py +++ b/ORStools/proc/directions_points_layers_proc.py @@ -109,13 +109,30 @@ def __init__(self): ), ] self.setToolTip(self.PARAMETERS[0], "Only Point layers are allowed, not MultiPoint.") - self.setToolTip(self.PARAMETERS[1], "Values will transfer to the output layer and can be used to join layers or group features afterwards.") - self.setToolTip(self.PARAMETERS[2], "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)") + self.setToolTip( + self.PARAMETERS[1], + "Values will transfer to the output layer and can be used to join layers or group features afterwards.", + ) + self.setToolTip( + self.PARAMETERS[2], + "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)", + ) self.setToolTip(self.PARAMETERS[3], "Only Point layers are allowed, not MultiPoint.") - self.setToolTip(self.PARAMETERS[4], "Values will transfer to the output layer and can be used to join layers or group features afterwards.") - self.setToolTip(self.PARAMETERS[5], "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)") - self.setToolTip(self.PARAMETERS[6], "Dictates the cost. For longer routes don't use Shortest Path.") - self.setToolTip(self.PARAMETERS[7], "Either 'row-by-row' until one layers has no more features or 'all-by-all' for every feature combination") + self.setToolTip( + self.PARAMETERS[4], + "Values will transfer to the output layer and can be used to join layers or group features afterwards.", + ) + self.setToolTip( + self.PARAMETERS[5], + "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)", + ) + self.setToolTip( + self.PARAMETERS[6], "Dictates the cost. For longer routes don't use Shortest Path." + ) + self.setToolTip( + self.PARAMETERS[7], + "Either 'row-by-row' until one layers has no more features or 'all-by-all' for every feature combination", + ) # TODO: preprocess parameters to options the range cleanup below: # https://www.qgis.org/pyqgis/master/core/Processing/QgsProcessingAlgorithm.html#qgis.core.QgsProcessingAlgorithm.preprocessParameters diff --git a/ORStools/proc/isochrones_layer_proc.py b/ORStools/proc/isochrones_layer_proc.py index 7cc81c5a..d92d100d 100644 --- a/ORStools/proc/isochrones_layer_proc.py +++ b/ORStools/proc/isochrones_layer_proc.py @@ -105,10 +105,22 @@ def __init__(self): ] self.setToolTip(self.PARAMETERS[0], "Only Point layers are allowed, not MultiPoint.") - self.setToolTip(self.PARAMETERS[1], "Values will transfer to the output layer and can be used to join layers or group features afterwards.") - self.setToolTip(self.PARAMETERS[3], "Parameter needs to be a comma-separated list of integer values, no decimal points.") - self.setToolTip(self.PARAMETERS[4], "Applies a level of generalisation to the isochrone polygons generated as a smoothing_factor between 0 and 100.") - self.setToolTip(self.PARAMETERS[5], "Start treats the location(s) as starting point, destination as goal.") + self.setToolTip( + self.PARAMETERS[1], + "Values will transfer to the output layer and can be used to join layers or group features afterwards.", + ) + self.setToolTip( + self.PARAMETERS[3], + "Parameter needs to be a comma-separated list of integer values, no decimal points.", + ) + self.setToolTip( + self.PARAMETERS[4], + "Applies a level of generalisation to the isochrone polygons generated as a smoothing_factor between 0 and 100.", + ) + self.setToolTip( + self.PARAMETERS[5], + "Start treats the location(s) as starting point, destination as goal.", + ) # Save some important references # TODO bad style, refactor diff --git a/ORStools/proc/isochrones_point_proc.py b/ORStools/proc/isochrones_point_proc.py index fb95b476..164283b9 100644 --- a/ORStools/proc/isochrones_point_proc.py +++ b/ORStools/proc/isochrones_point_proc.py @@ -91,9 +91,18 @@ def __init__(self): ] self.setToolTip(self.PARAMETERS[0], "Choose a Point from the map.") - self.setToolTip(self.PARAMETERS[2], "Parameter needs to be a comma-separated list of integer values, no decimal points.") - self.setToolTip(self.PARAMETERS[3], "Applies a level of generalisation to the isochrone polygons generated as a smoothing_factor between 0 and 100.") - self.setToolTip(self.PARAMETERS[4], "Start treats the location(s) as starting point, destination as goal.") + self.setToolTip( + self.PARAMETERS[2], + "Parameter needs to be a comma-separated list of integer values, no decimal points.", + ) + self.setToolTip( + self.PARAMETERS[3], + "Applies a level of generalisation to the isochrone polygons generated as a smoothing_factor between 0 and 100.", + ) + self.setToolTip( + self.PARAMETERS[4], + "Start treats the location(s) as starting point, destination as goal.", + ) # Save some important references # TODO bad style, refactor diff --git a/ORStools/proc/matrix_proc.py b/ORStools/proc/matrix_proc.py index f6ac968b..96f53b5d 100644 --- a/ORStools/proc/matrix_proc.py +++ b/ORStools/proc/matrix_proc.py @@ -83,9 +83,15 @@ def __init__(self): ] self.setToolTip(self.PARAMETERS[0], "Only Point layers are allowed, not MultiPoint.") - self.setToolTip(self.PARAMETERS[1], "Values will transfer to the output layer and can be used to join layers or group features afterwards.") + self.setToolTip( + self.PARAMETERS[1], + "Values will transfer to the output layer and can be used to join layers or group features afterwards.", + ) self.setToolTip(self.PARAMETERS[2], "Only Point layers are allowed, not MultiPoint.") - self.setToolTip(self.PARAMETERS[3], "Values will transfer to the output layer and can be used to join layers or group features afterwards.") + self.setToolTip( + self.PARAMETERS[3], + "Values will transfer to the output layer and can be used to join layers or group features afterwards.", + ) def processAlgorithm(self, parameters, context, feedback): ors_client = self._get_ors_client_from_provider(parameters[self.IN_PROVIDER], feedback) From 3d3785cb565da2048274e840aba5c5d5be6ff5b0 Mon Sep 17 00:00:00 2001 From: Merydian Date: Mon, 12 Feb 2024 15:07:55 +0100 Subject: [PATCH 11/13] docs : add changelog entry --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e39d9cb..34511acc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +40,9 @@ RELEASING: 14. Create new release in GitHub with tag version and release title of `vX.X.X` --> +# Unreleased + +- Add tooltip hints in processing algorithms ([#196](https://github.com/GIScience/orstools-qgis-plugin/issues/196)) ## [1.7.1] - 2024-01-15 From 7d442e1f9f5774ffb960335eef9406b45bf59082 Mon Sep 17 00:00:00 2001 From: Till Frankenbach Date: Mon, 5 May 2025 09:24:19 +0200 Subject: [PATCH 12/13] feat: wrap tooltip strings in translation methods --- ORStools/proc/base_processing_algorithm.py | 12 ++++++------ ORStools/proc/directions_lines_proc.py | 6 +++--- ORStools/proc/directions_points_layer_proc.py | 10 +++++----- ORStools/proc/directions_points_layers_proc.py | 14 +++++++------- ORStools/proc/isochrones_layer_proc.py | 10 +++++----- ORStools/proc/isochrones_point_proc.py | 8 ++++---- ORStools/proc/matrix_proc.py | 6 +++--- 7 files changed, 33 insertions(+), 33 deletions(-) diff --git a/ORStools/proc/base_processing_algorithm.py b/ORStools/proc/base_processing_algorithm.py index b6d40c5c..cac6bf8a 100644 --- a/ORStools/proc/base_processing_algorithm.py +++ b/ORStools/proc/base_processing_algorithm.py @@ -123,7 +123,7 @@ def provider_parameter(self) -> QgsProcessingParameterEnum: defaultValue=providers[0], ) - self.setToolTip(parameter, "Select the provider that should be used.") + self.setToolTip(parameter, self.tr("Select the provider that should be used.")) return parameter @@ -150,7 +150,7 @@ def output_parameter(self) -> QgsProcessingParameterFeatureSink: name=self.OUT, description=self.GROUP, ) - self.setToolTip(parameter, "Select where the output should be saved.") + self.setToolTip(parameter, self.tr("Select where the output should be saved.")) return parameter @@ -188,10 +188,10 @@ def option_parameters(self) -> [QgsProcessingParameterDefinition]: ), ] - self.setToolTip(parameters[0], "Select features that should be avoided by the algorithm.") - self.setToolTip(parameters[1], "Select borders that should be avoided by the algorithm.") - self.setToolTip(parameters[2], "Select countries that should be avoided by the algorithm.") - self.setToolTip(parameters[3], "Select polygons that should be avoided by the algorithm.") + self.setToolTip(parameters[0], self.tr("Select features that should be avoided by the algorithm.")) + self.setToolTip(parameters[1], self.tr("Select borders that should be avoided by the algorithm.")) + self.setToolTip(parameters[2], self.tr("Select countries that should be avoided by the algorithm.")) + self.setToolTip(parameters[3], self.tr("Select polygons that should be avoided by the algorithm.")) return parameters diff --git a/ORStools/proc/directions_lines_proc.py b/ORStools/proc/directions_lines_proc.py index 6596a51b..bfcf0bcf 100644 --- a/ORStools/proc/directions_lines_proc.py +++ b/ORStools/proc/directions_lines_proc.py @@ -87,14 +87,14 @@ def __init__(self): self.setToolTip(self.PARAMETERS[0], "LineString or MultiLineString layer.") self.setToolTip( self.PARAMETERS[1], - "Values will transfer to the output layer and can be used to join layers or group features afterwards.", + self.tr("Values will transfer to the output layer and can be used to join layers or group features afterwards."), ) self.setToolTip( - self.PARAMETERS[2], "Dictates the cost. For longer routes don't use Shortest Path." + self.PARAMETERS[2], self.tr("Dictates the cost. For longer routes don't use Shortest Path.") ) self.setToolTip( self.PARAMETERS[3], - "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.", + 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."), ) def processAlgorithm(self, parameters, context, feedback): diff --git a/ORStools/proc/directions_points_layer_proc.py b/ORStools/proc/directions_points_layer_proc.py index 68672786..ba4ece6e 100644 --- a/ORStools/proc/directions_points_layer_proc.py +++ b/ORStools/proc/directions_points_layer_proc.py @@ -92,21 +92,21 @@ def __init__(self): ), ] - self.setToolTip(self.PARAMETERS[0], "Point or MultiPoint layer.") + self.setToolTip(self.PARAMETERS[0], self.tr("Point or MultiPoint layer.")) self.setToolTip( self.PARAMETERS[1], - "Values will transfer to the output layer and can be used to join layers or group features afterwards.", + self.tr("Values will transfer to the output layer and can be used to join layers or group features afterwards."), ) self.setToolTip( self.PARAMETERS[2], - "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).", + 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)."), ) self.setToolTip( - self.PARAMETERS[3], "Dictates the cost. For longer routes don't use Shortest Path." + self.PARAMETERS[3], self.tr("Dictates the cost. For longer routes don't use Shortest Path.") ) self.setToolTip( self.PARAMETERS[4], - "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.", + 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."), ) def processAlgorithm(self, parameters, context, feedback): diff --git a/ORStools/proc/directions_points_layers_proc.py b/ORStools/proc/directions_points_layers_proc.py index b9fb6af2..87d7fa8c 100644 --- a/ORStools/proc/directions_points_layers_proc.py +++ b/ORStools/proc/directions_points_layers_proc.py @@ -108,30 +108,30 @@ def __init__(self): defaultValue=self.MODE_SELECTION[0], ), ] - self.setToolTip(self.PARAMETERS[0], "Only Point layers are allowed, not MultiPoint.") + self.setToolTip(self.PARAMETERS[0], self.tr("Only Point layers are allowed, not MultiPoint.")) self.setToolTip( self.PARAMETERS[1], - "Values will transfer to the output layer and can be used to join layers or group features afterwards.", + self.tr("Values will transfer to the output layer and can be used to join layers or group features afterwards."), ) self.setToolTip( self.PARAMETERS[2], - "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)", + 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)"), ) self.setToolTip(self.PARAMETERS[3], "Only Point layers are allowed, not MultiPoint.") self.setToolTip( self.PARAMETERS[4], - "Values will transfer to the output layer and can be used to join layers or group features afterwards.", + self.tr("Values will transfer to the output layer and can be used to join layers or group features afterwards."), ) self.setToolTip( self.PARAMETERS[5], - "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)", + 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)"), ) self.setToolTip( - self.PARAMETERS[6], "Dictates the cost. For longer routes don't use Shortest Path." + self.PARAMETERS[6], self.tr("Dictates the cost. For longer routes don't use Shortest Path.") ) self.setToolTip( self.PARAMETERS[7], - "Either 'row-by-row' until one layers has no more features or 'all-by-all' for every feature combination", + self.tr("Either 'row-by-row' until one layers has no more features or 'all-by-all' for every feature combination"), ) # TODO: preprocess parameters to options the range cleanup below: diff --git a/ORStools/proc/isochrones_layer_proc.py b/ORStools/proc/isochrones_layer_proc.py index d92d100d..706a0dc8 100644 --- a/ORStools/proc/isochrones_layer_proc.py +++ b/ORStools/proc/isochrones_layer_proc.py @@ -104,22 +104,22 @@ def __init__(self): ), ] - self.setToolTip(self.PARAMETERS[0], "Only Point layers are allowed, not MultiPoint.") + self.setToolTip(self.PARAMETERS[0], self.tr("Only Point layers are allowed, not MultiPoint.")) self.setToolTip( self.PARAMETERS[1], - "Values will transfer to the output layer and can be used to join layers or group features afterwards.", + self.tr("Values will transfer to the output layer and can be used to join layers or group features afterwards."), ) self.setToolTip( self.PARAMETERS[3], - "Parameter needs to be a comma-separated list of integer values, no decimal points.", + self.tr("Parameter needs to be a comma-separated list of integer values, no decimal points."), ) self.setToolTip( self.PARAMETERS[4], - "Applies a level of generalisation to the isochrone polygons generated as a smoothing_factor between 0 and 100.", + self.tr("Applies a level of generalisation to the isochrone polygons generated as a smoothing_factor between 0 and 100."), ) self.setToolTip( self.PARAMETERS[5], - "Start treats the location(s) as starting point, destination as goal.", + self.tr("Start treats the location(s) as starting point, destination as goal."), ) # Save some important references diff --git a/ORStools/proc/isochrones_point_proc.py b/ORStools/proc/isochrones_point_proc.py index 164283b9..57069675 100644 --- a/ORStools/proc/isochrones_point_proc.py +++ b/ORStools/proc/isochrones_point_proc.py @@ -90,18 +90,18 @@ def __init__(self): ), ] - self.setToolTip(self.PARAMETERS[0], "Choose a Point from the map.") + self.setToolTip(self.PARAMETERS[0], self.tr("Choose a Point from the map.")) self.setToolTip( self.PARAMETERS[2], - "Parameter needs to be a comma-separated list of integer values, no decimal points.", + self.tr("Parameter needs to be a comma-separated list of integer values, no decimal points."), ) self.setToolTip( self.PARAMETERS[3], - "Applies a level of generalisation to the isochrone polygons generated as a smoothing_factor between 0 and 100.", + self.tr("Applies a level of generalisation to the isochrone polygons generated as a smoothing_factor between 0 and 100."), ) self.setToolTip( self.PARAMETERS[4], - "Start treats the location(s) as starting point, destination as goal.", + self.tr("Start treats the location(s) as starting point, destination as goal."), ) # Save some important references diff --git a/ORStools/proc/matrix_proc.py b/ORStools/proc/matrix_proc.py index 96f53b5d..e68c468a 100644 --- a/ORStools/proc/matrix_proc.py +++ b/ORStools/proc/matrix_proc.py @@ -82,15 +82,15 @@ def __init__(self): ), ] - self.setToolTip(self.PARAMETERS[0], "Only Point layers are allowed, not MultiPoint.") + self.setToolTip(self.PARAMETERS[0], self.tr("Only Point layers are allowed, not MultiPoint.")) self.setToolTip( self.PARAMETERS[1], - "Values will transfer to the output layer and can be used to join layers or group features afterwards.", + self.tr("Values will transfer to the output layer and can be used to join layers or group features afterwards."), ) self.setToolTip(self.PARAMETERS[2], "Only Point layers are allowed, not MultiPoint.") self.setToolTip( self.PARAMETERS[3], - "Values will transfer to the output layer and can be used to join layers or group features afterwards.", + self.tr("Values will transfer to the output layer and can be used to join layers or group features afterwards."), ) def processAlgorithm(self, parameters, context, feedback): From 5a56592a3b25f719941b9c28b5c3c401add1395d Mon Sep 17 00:00:00 2001 From: Till Frankenbach Date: Mon, 5 May 2025 09:26:47 +0200 Subject: [PATCH 13/13] style: run ruff --- ORStools/proc/base_processing_algorithm.py | 17 +++++++++--- ORStools/proc/directions_lines_proc.py | 11 +++++--- ORStools/proc/directions_points_layer_proc.py | 15 ++++++++--- .../proc/directions_points_layers_proc.py | 27 ++++++++++++++----- ORStools/proc/isochrones_layer_proc.py | 16 ++++++++--- ORStools/proc/isochrones_point_proc.py | 8 ++++-- ORStools/proc/matrix_proc.py | 12 ++++++--- ORStools/utils/configmanager.py | 1 + ORStools/utils/processing.py | 1 + 9 files changed, 81 insertions(+), 27 deletions(-) diff --git a/ORStools/proc/base_processing_algorithm.py b/ORStools/proc/base_processing_algorithm.py index cac6bf8a..0d966eac 100644 --- a/ORStools/proc/base_processing_algorithm.py +++ b/ORStools/proc/base_processing_algorithm.py @@ -26,6 +26,7 @@ * * ***************************************************************************/ """ + from PyQt5.QtCore import QCoreApplication, QSettings from qgis.core import ( QgsProcessing, @@ -188,10 +189,18 @@ def option_parameters(self) -> [QgsProcessingParameterDefinition]: ), ] - self.setToolTip(parameters[0], self.tr("Select features that should be avoided by the algorithm.")) - self.setToolTip(parameters[1], self.tr("Select borders that should be avoided by the algorithm.")) - self.setToolTip(parameters[2], self.tr("Select countries that should be avoided by the algorithm.")) - self.setToolTip(parameters[3], self.tr("Select polygons that should be avoided by the algorithm.")) + self.setToolTip( + parameters[0], self.tr("Select features that should be avoided by the algorithm.") + ) + self.setToolTip( + parameters[1], self.tr("Select borders that should be avoided by the algorithm.") + ) + self.setToolTip( + parameters[2], self.tr("Select countries that should be avoided by the algorithm.") + ) + self.setToolTip( + parameters[3], self.tr("Select polygons that should be avoided by the algorithm.") + ) return parameters diff --git a/ORStools/proc/directions_lines_proc.py b/ORStools/proc/directions_lines_proc.py index bfcf0bcf..8f1be72f 100644 --- a/ORStools/proc/directions_lines_proc.py +++ b/ORStools/proc/directions_lines_proc.py @@ -87,14 +87,19 @@ def __init__(self): self.setToolTip(self.PARAMETERS[0], "LineString or MultiLineString layer.") self.setToolTip( self.PARAMETERS[1], - self.tr("Values will transfer to the output layer and can be used to join layers or group features afterwards."), + self.tr( + "Values will transfer to the output layer and can be used to join layers or group features afterwards." + ), ) self.setToolTip( - self.PARAMETERS[2], self.tr("Dictates the cost. For longer routes don't use Shortest Path.") + self.PARAMETERS[2], + self.tr("Dictates the cost. For longer routes don't use Shortest Path."), ) self.setToolTip( self.PARAMETERS[3], - 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."), + 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." + ), ) def processAlgorithm(self, parameters, context, feedback): diff --git a/ORStools/proc/directions_points_layer_proc.py b/ORStools/proc/directions_points_layer_proc.py index ba4ece6e..4a3c5f2a 100644 --- a/ORStools/proc/directions_points_layer_proc.py +++ b/ORStools/proc/directions_points_layer_proc.py @@ -95,18 +95,25 @@ def __init__(self): self.setToolTip(self.PARAMETERS[0], self.tr("Point or MultiPoint layer.")) self.setToolTip( self.PARAMETERS[1], - self.tr("Values will transfer to the output layer and can be used to join layers or group features afterwards."), + self.tr( + "Values will transfer to the output layer and can be used to join layers or group features afterwards." + ), ) self.setToolTip( self.PARAMETERS[2], - 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)."), + 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)." + ), ) self.setToolTip( - self.PARAMETERS[3], self.tr("Dictates the cost. For longer routes don't use Shortest Path.") + self.PARAMETERS[3], + self.tr("Dictates the cost. For longer routes don't use Shortest Path."), ) self.setToolTip( self.PARAMETERS[4], - 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."), + 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." + ), ) def processAlgorithm(self, parameters, context, feedback): diff --git a/ORStools/proc/directions_points_layers_proc.py b/ORStools/proc/directions_points_layers_proc.py index 87d7fa8c..49d09367 100644 --- a/ORStools/proc/directions_points_layers_proc.py +++ b/ORStools/proc/directions_points_layers_proc.py @@ -108,30 +108,43 @@ def __init__(self): defaultValue=self.MODE_SELECTION[0], ), ] - self.setToolTip(self.PARAMETERS[0], self.tr("Only Point layers are allowed, not MultiPoint.")) + self.setToolTip( + self.PARAMETERS[0], self.tr("Only Point layers are allowed, not MultiPoint.") + ) self.setToolTip( self.PARAMETERS[1], - self.tr("Values will transfer to the output layer and can be used to join layers or group features afterwards."), + self.tr( + "Values will transfer to the output layer and can be used to join layers or group features afterwards." + ), ) self.setToolTip( self.PARAMETERS[2], - 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)"), + 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)" + ), ) self.setToolTip(self.PARAMETERS[3], "Only Point layers are allowed, not MultiPoint.") self.setToolTip( self.PARAMETERS[4], - self.tr("Values will transfer to the output layer and can be used to join layers or group features afterwards."), + self.tr( + "Values will transfer to the output layer and can be used to join layers or group features afterwards." + ), ) self.setToolTip( self.PARAMETERS[5], - 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)"), + 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)" + ), ) self.setToolTip( - self.PARAMETERS[6], self.tr("Dictates the cost. For longer routes don't use Shortest Path.") + self.PARAMETERS[6], + self.tr("Dictates the cost. For longer routes don't use Shortest Path."), ) self.setToolTip( self.PARAMETERS[7], - self.tr("Either 'row-by-row' until one layers has no more features or 'all-by-all' for every feature combination"), + self.tr( + "Either 'row-by-row' until one layers has no more features or 'all-by-all' for every feature combination" + ), ) # TODO: preprocess parameters to options the range cleanup below: diff --git a/ORStools/proc/isochrones_layer_proc.py b/ORStools/proc/isochrones_layer_proc.py index 706a0dc8..ca1bb5c4 100644 --- a/ORStools/proc/isochrones_layer_proc.py +++ b/ORStools/proc/isochrones_layer_proc.py @@ -104,18 +104,26 @@ def __init__(self): ), ] - self.setToolTip(self.PARAMETERS[0], self.tr("Only Point layers are allowed, not MultiPoint.")) + self.setToolTip( + self.PARAMETERS[0], self.tr("Only Point layers are allowed, not MultiPoint.") + ) self.setToolTip( self.PARAMETERS[1], - self.tr("Values will transfer to the output layer and can be used to join layers or group features afterwards."), + self.tr( + "Values will transfer to the output layer and can be used to join layers or group features afterwards." + ), ) self.setToolTip( self.PARAMETERS[3], - self.tr("Parameter needs to be a comma-separated list of integer values, no decimal points."), + self.tr( + "Parameter needs to be a comma-separated list of integer values, no decimal points." + ), ) self.setToolTip( self.PARAMETERS[4], - self.tr("Applies a level of generalisation to the isochrone polygons generated as a smoothing_factor between 0 and 100."), + self.tr( + "Applies a level of generalisation to the isochrone polygons generated as a smoothing_factor between 0 and 100." + ), ) self.setToolTip( self.PARAMETERS[5], diff --git a/ORStools/proc/isochrones_point_proc.py b/ORStools/proc/isochrones_point_proc.py index 57069675..ba02eb7e 100644 --- a/ORStools/proc/isochrones_point_proc.py +++ b/ORStools/proc/isochrones_point_proc.py @@ -93,11 +93,15 @@ def __init__(self): self.setToolTip(self.PARAMETERS[0], self.tr("Choose a Point from the map.")) self.setToolTip( self.PARAMETERS[2], - self.tr("Parameter needs to be a comma-separated list of integer values, no decimal points."), + self.tr( + "Parameter needs to be a comma-separated list of integer values, no decimal points." + ), ) self.setToolTip( self.PARAMETERS[3], - self.tr("Applies a level of generalisation to the isochrone polygons generated as a smoothing_factor between 0 and 100."), + self.tr( + "Applies a level of generalisation to the isochrone polygons generated as a smoothing_factor between 0 and 100." + ), ) self.setToolTip( self.PARAMETERS[4], diff --git a/ORStools/proc/matrix_proc.py b/ORStools/proc/matrix_proc.py index e68c468a..96bd5060 100644 --- a/ORStools/proc/matrix_proc.py +++ b/ORStools/proc/matrix_proc.py @@ -82,15 +82,21 @@ def __init__(self): ), ] - self.setToolTip(self.PARAMETERS[0], self.tr("Only Point layers are allowed, not MultiPoint.")) + self.setToolTip( + self.PARAMETERS[0], self.tr("Only Point layers are allowed, not MultiPoint.") + ) self.setToolTip( self.PARAMETERS[1], - self.tr("Values will transfer to the output layer and can be used to join layers or group features afterwards."), + self.tr( + "Values will transfer to the output layer and can be used to join layers or group features afterwards." + ), ) self.setToolTip(self.PARAMETERS[2], "Only Point layers are allowed, not MultiPoint.") self.setToolTip( self.PARAMETERS[3], - self.tr("Values will transfer to the output layer and can be used to join layers or group features afterwards."), + self.tr( + "Values will transfer to the output layer and can be used to join layers or group features afterwards." + ), ) def processAlgorithm(self, parameters, context, feedback): diff --git a/ORStools/utils/configmanager.py b/ORStools/utils/configmanager.py index 26e4d614..0005e0c4 100644 --- a/ORStools/utils/configmanager.py +++ b/ORStools/utils/configmanager.py @@ -26,6 +26,7 @@ * * ***************************************************************************/ """ + import os import yaml diff --git a/ORStools/utils/processing.py b/ORStools/utils/processing.py index 86c16a97..5d627811 100644 --- a/ORStools/utils/processing.py +++ b/ORStools/utils/processing.py @@ -26,6 +26,7 @@ * * ***************************************************************************/ """ + import os from qgis.core import QgsPointXY