From 15f2b90bf7223dcab2a65624e9d49784a2ae5ffc Mon Sep 17 00:00:00 2001 From: mhhd2020 <74619995+mhhd2020@users.noreply.github.com> Date: Sun, 23 Jul 2023 14:54:22 +0200 Subject: [PATCH] Run autoformatters --- .../qgis_scripts/count_duplicates.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/sketch_map_tool/upload_processing/qgis_scripts/count_duplicates.py b/sketch_map_tool/upload_processing/qgis_scripts/count_duplicates.py index ccba59fe..a9a4b6b9 100644 --- a/sketch_map_tool/upload_processing/qgis_scripts/count_duplicates.py +++ b/sketch_map_tool/upload_processing/qgis_scripts/count_duplicates.py @@ -3,7 +3,6 @@ Helper script for 'count_overlaps'. """ -import processing from PyQt5.QtCore import QCoreApplication, QVariant from qgis.core import ( QgsFeature, @@ -14,7 +13,6 @@ QgsProcessingException, QgsProcessingParameterFeatureSink, QgsProcessingParameterFeatureSource, - QgsProcessingParameterString, ) @@ -101,7 +99,9 @@ def processAlgorithm(self, parameters, context, feedback): for i, feature in enumerate(features): attributes = feature.attributes() del attributes[name_index] - attributes += [0] * (len(out_fields) - len(attributes)) # Initialise new fields with zero + attributes += [0] * ( + len(out_fields) - len(attributes) + ) # Initialise new fields with zero count = 0 # Each feature has the same geometry as itself, so the count will be incremented by one in any # case in the following inner loop @@ -109,8 +109,12 @@ def processAlgorithm(self, parameters, context, feedback): features_ = source.getFeatures() for j, other_feature in enumerate(features_): if feature.geometry().equals(other_feature.geometry()): - feature_id = other_feature.attributes()[name_index] # Name of the sketch map this marking is from - attributes[out_fields.indexOf(str(feature_id))] = 1 # Set the indicator variable for this + feature_id = other_feature.attributes()[ + name_index + ] # Name of the sketch map this marking is from + attributes[ + out_fields.indexOf(str(feature_id)) + ] = 1 # Set the indicator variable for this # sketch map to one count += 1 if j >= i: # duplicate feature not already added