From 31f82804c5ab7ed940fbc91bafb33779fc6f8964 Mon Sep 17 00:00:00 2001 From: "V. Armando Sole" Date: Fri, 16 Jun 2023 17:28:17 +0200 Subject: [PATCH 1/4] Adapt to non QThreads --- PyMca5/PyMcaPlugins/FastXRFLinearFitStackPlugin.py | 3 +-- PyMca5/PyMcaPlugins/StackROIBatchPlugin.py | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/PyMca5/PyMcaPlugins/FastXRFLinearFitStackPlugin.py b/PyMca5/PyMcaPlugins/FastXRFLinearFitStackPlugin.py index 8ba755cb9..cf1c97e10 100644 --- a/PyMca5/PyMcaPlugins/FastXRFLinearFitStackPlugin.py +++ b/PyMca5/PyMcaPlugins/FastXRFLinearFitStackPlugin.py @@ -146,16 +146,15 @@ def _executeFunctionAndParameters(self): self.thread = CalculationThread.CalculationThread(\ calculation_method=self.actualCalculation) self.thread.result = self.actualCalculation() - self.threadFinished() else: self.thread = CalculationThread.CalculationThread(\ calculation_method=self.actualCalculation) - self.thread.finished.connect(self.threadFinished) self.thread.start() message = "Please wait. Calculation going on." CalculationThread.waitingMessageDialog(self.thread, parent=self.configurationWidget, message=message) + self.threadFinished() def actualCalculation(self): activeCurve = self.getActiveCurve() diff --git a/PyMca5/PyMcaPlugins/StackROIBatchPlugin.py b/PyMca5/PyMcaPlugins/StackROIBatchPlugin.py index 6d9e6b09c..eecf18bfd 100644 --- a/PyMca5/PyMcaPlugins/StackROIBatchPlugin.py +++ b/PyMca5/PyMcaPlugins/StackROIBatchPlugin.py @@ -160,16 +160,15 @@ def _executeFunctionAndParameters(self): self.thread = CalculationThread.CalculationThread(\ calculation_method=self.actualCalculation) self.thread.result = self.actualCalculation() - self.threadFinished() else: self.thread = CalculationThread.CalculationThread(\ calculation_method=self.actualCalculation) - self.thread.finished.connect(self.threadFinished) self.thread.start() message = "Please wait. Calculation going on." CalculationThread.waitingMessageDialog(self.thread, parent=self.configurationWidget, message=message) + self.threadFinished() def actualCalculation(self): activeCurve = self.getActiveCurve() From 00f3cf034b1e705f627e430fb1b562e3d28f7cda Mon Sep 17 00:00:00 2001 From: "V. Armando Sole" Date: Fri, 16 Jun 2023 17:32:18 +0200 Subject: [PATCH 2/4] Compatibility with python threads --- PyMca5/PyMcaPlugins/XASStackBatchPlugin.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/PyMca5/PyMcaPlugins/XASStackBatchPlugin.py b/PyMca5/PyMcaPlugins/XASStackBatchPlugin.py index 6fd06226d..1e03596bf 100644 --- a/PyMca5/PyMcaPlugins/XASStackBatchPlugin.py +++ b/PyMca5/PyMcaPlugins/XASStackBatchPlugin.py @@ -150,16 +150,15 @@ def _executeFunctionAndParameters(self): self.thread = CalculationThread.CalculationThread(\ calculation_method=self.actualCalculation) self.thread.result = self.actualCalculation() - self.threadFinished() else: self.thread = CalculationThread.CalculationThread(\ calculation_method=self.actualCalculation) - self.thread.finished.connect(self.threadFinished) self.thread.start() message = "Please wait. Calculation going on." CalculationThread.waitingMessageDialog(self.thread, parent=self.configurationWidget, message=message) + self.threadFinished() def actualCalculation(self): activeCurve = self.getActiveCurve() From e76a8b741d5e868925a03ded306e9464c9168e40 Mon Sep 17 00:00:00 2001 From: "V. Armando Sole" Date: Fri, 16 Jun 2023 17:34:20 +0200 Subject: [PATCH 3/4] Remove long-time deprecated module. --- PyMca5/PyMcaPlugins/CalculationThread.py | 32 ------------------------ 1 file changed, 32 deletions(-) delete mode 100644 PyMca5/PyMcaPlugins/CalculationThread.py diff --git a/PyMca5/PyMcaPlugins/CalculationThread.py b/PyMca5/PyMcaPlugins/CalculationThread.py deleted file mode 100644 index 6e0d825f3..000000000 --- a/PyMca5/PyMcaPlugins/CalculationThread.py +++ /dev/null @@ -1,32 +0,0 @@ -#/*########################################################################## -# Copyright (C) 2004-2015 V.A. Sole, European Synchrotron Radiation Facility -# -# This file is part of the PyMca X-ray Fluorescence Toolkit developed at -# the ESRF by the Software group. -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. -# -#############################################################################*/ -__author__ = "V.A. Sole - ESRF Data Analysis" -__contact__ = "sole@esrf.fr" -__license__ = "MIT" -__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France" -print("Update your plugins") -print("Please use from PyMca5.PyMcaGui import CalculationThread") -from PyMca5.PyMcaGui.misc.CalculationThread import * From f1e901f1df8dc0c27cf091664797613e0bdc7f22 Mon Sep 17 00:00:00 2001 From: "V. Armando Sole" Date: Fri, 16 Jun 2023 17:53:02 +0200 Subject: [PATCH 4/4] Update version and changelog.txt --- PyMca5/__init__.py | 2 +- changelog.txt | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/PyMca5/__init__.py b/PyMca5/__init__.py index 2ba823b43..22ac966c0 100644 --- a/PyMca5/__init__.py +++ b/PyMca5/__init__.py @@ -27,7 +27,7 @@ __contact__ = "sole@esrf.fr" __license__ = "MIT" __copyright__ = "European Synchrotron Radiation Facility, Grenoble, France" -__version__ = "5.8.6" +__version__ = "5.8.7" import os import sys diff --git a/changelog.txt b/changelog.txt index edd0397ce..046e46d1e 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,8 @@ +VERSION 5.8.7 +------------- + +- ROI Imaging. Correct plugin threading issues introduced in version 5.8.2 + VERSION 5.8.6 -------------