From 14c3b6535ed0591b0f7285aa0c2c8a996fb092cf Mon Sep 17 00:00:00 2001 From: ptresson <paul.tresson@ird.fr> Date: Thu, 24 Oct 2024 17:01:12 +0200 Subject: [PATCH] replace config and contexts in initAlgorithm and postprocessing --- ml.py | 4 ++-- utils/algo.py | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ml.py b/ml.py index 3ab11f2..a843b07 100644 --- a/ml.py +++ b/ml.py @@ -71,7 +71,7 @@ class MLAlgorithm(SHPAlgorithm): DEFAULT_TEMPLATE = 'ml_poly.shp' TYPE = 'ml' - def initAlgorithm(self): + def initAlgorithm(self, config=None): """ Here we define the inputs and output of the algorithm, along with some other properties. @@ -493,7 +493,7 @@ class MLAlgorithm(SHPAlgorithm): return help_str # used to handle any thread-sensitive cleanup which is required by the algorithm. - def postProcessAlgorithm(self) -> Dict[str, Any]: + def postProcessAlgorithm(self, context, feedback) -> Dict[str, Any]: return {} diff --git a/utils/algo.py b/utils/algo.py index 31fbffc..12ab8a8 100644 --- a/utils/algo.py +++ b/utils/algo.py @@ -111,7 +111,7 @@ class IAMAPAlgorithm(QgsProcessingAlgorithm): TMP_DIR = 'iamap_tmp' - def initAlgorithm(self): + def initAlgorithm(self, config=None): """ Here we define the inputs and output of the algorithm, along with some other properties. @@ -403,7 +403,7 @@ class IAMAPAlgorithm(QgsProcessingAlgorithm): return dst_path # used to handle any thread-sensitive cleanup which is required by the algorithm. - def postProcessAlgorithm(self) -> Dict[str, Any]: + def postProcessAlgorithm(self, context, feedback) -> Dict[str, Any]: return {} @@ -426,7 +426,7 @@ class SKAlgorithm(IAMAPAlgorithm): TYPE = 'proj' - def initAlgorithm(self): + def initAlgorithm(self, config=None): """ Here we define the inputs and output of the algorithm, along with some other properties. @@ -838,7 +838,7 @@ class SKAlgorithm(IAMAPAlgorithm): # feedback.pushInfo(f'Silouhette Values : \n{silhouette_values(fit_raster, model.labels_)}') # used to handle any thread-sensitive cleanup which is required by the algorithm. - def postProcessAlgorithm(self) -> Dict[str, Any]: + def postProcessAlgorithm(self, context, feedback) -> Dict[str, Any]: return {} @@ -855,7 +855,7 @@ class SHPAlgorithm(IAMAPAlgorithm): TYPE = 'similarity' - def initAlgorithm(self): + def initAlgorithm(self, config=None): """ Here we define the inputs and output of the algorithm, along with some other properties. @@ -1030,7 +1030,7 @@ class SHPAlgorithm(IAMAPAlgorithm): # used to handle any thread-sensitive cleanup which is required by the algorithm. - def postProcessAlgorithm(self) -> Dict[str, Any]: + def postProcessAlgorithm(self, context, feedback) -> Dict[str, Any]: return {} if __name__ == "__main__": -- GitLab