diff --git a/doc/source/usage/tutorial/Parallelization/MultiGPU.ipynb b/doc/source/usage/tutorial/Parallelization/MultiGPU.ipynb index c68d08519..942824abd 100644 --- a/doc/source/usage/tutorial/Parallelization/MultiGPU.ipynb +++ b/doc/source/usage/tutorial/Parallelization/MultiGPU.ipynb @@ -584,7 +584,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.12" + "version": "3.13.1" } }, "nbformat": 4, diff --git a/src/pyFAI/app/calib2.py b/src/pyFAI/app/calib2.py index f34cba56e..5cefde39b 100755 --- a/src/pyFAI/app/calib2.py +++ b/src/pyFAI/app/calib2.py @@ -28,7 +28,7 @@ __contact__ = "valentin.valls@esrf.eu" __license__ = "MIT" __copyright__ = "European Synchrotron Radiation Facility, Grenoble, France" -__date__ = "10/11/2025" +__date__ = "21/11/2025" __status__ = "production" import os @@ -37,11 +37,13 @@ from argparse import ArgumentParser import logging -import pyFAI.resources -import pyFAI.calibrant -import pyFAI.detectors -import pyFAI.io.image -from pyFAI.io.ponifile import PoniFile +from .. import resources +from .. import calibrant +from .. import detectors +from ..io import image +from ..io.ponifile import PoniFile +from .. import version as pyFAI_version, date as pyFAI_date +from .. import units as pyFAI_units logging.basicConfig(level=logging.INFO) logging.captureWarnings(True) @@ -85,7 +87,7 @@ def configure_parser_arguments(parser): parser.add_argument("-w", "--wavelength", dest="wavelength", type=float, help="wavelength of the X-Ray beam in Angstrom.", default=None) parser.add_argument("-e", "--energy", dest="energy", type=float, - help="energy of the X-Ray beam in keV (hc=%skeV.A)." % pyFAI.units.hc, default=None) + help="energy of the X-Ray beam in keV (hc=%skeV.A)." % pyFAI_units.hc, default=None) parser.add_argument("-P", "--polarization", dest="polarization_factor", type=float, default=None, help="polarization factor, from -1 (vertical) to +1 (horizontal)," + @@ -251,7 +253,7 @@ def configure_parser_arguments(parser): You will need to provide a calibrant or a "d-spacing" file containing the spacing of Miller plans in Angstrom (in decreasing order). %s or search in the American Mineralogist database: -http://rruff.geo.arizona.edu/AMS/amcsd.php""" % str(pyFAI.calibrant.ALL_CALIBRANTS) +http://rruff.geo.arizona.edu/AMS/amcsd.php""" % str(calibrant.ALL_CALIBRANTS) epilog = """The output of this program is a "PONI" file containing the detector description and the 6 refined parameters (distance, center, rotation) @@ -294,7 +296,7 @@ def parse_options(): """ usage = "pyFAI-calib2 [options] input_image.edf" parser = ArgumentParser(usage=usage, description=description, epilog=epilog) - version = "calibration from pyFAI version %s: %s" % (pyFAI.version, pyFAI.date) + version = "calibration from pyFAI version %s: %s" % (pyFAI_version, pyFAI_date) parser.add_argument("-V", "--version", action='version', version=version) configure_parser_arguments(parser) @@ -333,10 +335,10 @@ def setup_model(model, options): if options.spacing: calibrant = None try: - if options.spacing in pyFAI.calibrant.CALIBRANT_FACTORY: - calibrant = pyFAI.calibrant.CALIBRANT_FACTORY(options.spacing) + if options.spacing in calibrant.CALIBRANT_FACTORY: + calibrant = calibrant.CALIBRANT_FACTORY(options.spacing) elif os.path.isfile(options.spacing): - calibrant = pyFAI.calibrant.Calibrant(options.spacing) + calibrant = calibrant.Calibrant(options.spacing) else: logger.error("No such Calibrant / d-Spacing file: %s", options.spacing) except Exception as e: @@ -366,15 +368,15 @@ def setup_model(model, options): displayExceptionBox("Error while loading the detector", e) elif options.pixel: pixel_size = parse_pixel_size(options.pixel) - detector = pyFAI.detectors.Detector(pixel1=pixel_size[0], pixel2=pixel_size[0]) + detector = detectors.Detector(pixel1=pixel_size[0], pixel2=pixel_size[0]) else: detector = None if options.spline: try: if detector is None: - detector = pyFAI.detectors.Detector(splinefile=options.spline) - elif detector.__class__ is pyFAI.detectors.Detector or detector.HAVE_TAPER: + detector = detectors.Detector(splinefile=options.spline) + elif detector.__class__ is detectors.Detector or detector.HAVE_TAPER: detector.splinefile = options.spline else: logger.warning("Spline file not supported with this kind of detector. Argument ignored.") @@ -414,7 +416,7 @@ def setup_model(model, options): if options.mask: try: - data = pyFAI.io.image.read_image_data(options.mask) + data = image.read_image_data(options.mask) except Exception as e: displayExceptionBox("Error while loading the mask", e) else: @@ -427,7 +429,7 @@ def setup_model(model, options): elif len(args) == 1: image_file = args[0] try: - data = pyFAI.io.image.read_image_data(image_file) + data = image.read_image_data(image_file) except Exception as e: displayExceptionBox("Error while loading the image", e) else: @@ -517,7 +519,7 @@ def setup_model(model, options): # Integration if options.unit: - unit = pyFAI.units.to_unit(options.unit) + unit = pyFAI_units.to_unit(options.unit) integrationSettingsModel.radialUnit().setValue(unit) if options.outfile: @@ -536,7 +538,7 @@ def setup_model(model, options): logger.error("background option not supported") if options.dark: try: - data = pyFAI.io.image.read_image_data(options.dark) + data = image.read_image_data(options.dark) except Exception as e: displayExceptionBox("Error while loading the dark current image", e) else: @@ -546,7 +548,7 @@ def setup_model(model, options): image_model.setSynchronized(True) if options.flat: try: - data = pyFAI.io.image.read_image_data(options.flat) + data = image.read_image_data(options.flat) except Exception as e: displayExceptionBox("Error while loading the flat-field image", e) else: @@ -616,8 +618,8 @@ def main(): # Make sure matplotlib is loaded first by silx import silx.gui.utils.matplotlib - from pyFAI.gui.CalibrationWindow import CalibrationWindow - from pyFAI.gui.CalibrationContext import CalibrationContext + from ..gui.CalibrationWindow import CalibrationWindow + from ..gui.CalibrationContext import CalibrationContext sys.excepthook = logUncaughtExceptions if options.qtargs is None: @@ -625,7 +627,7 @@ def main(): else: qtArgs = options.qtargs.split() app = qt.QApplication(qtArgs) - pyFAI.resources.silx_integration() + resources.silx_integration() settings = qt.QSettings(qt.QSettings.IniFormat, qt.QSettings.UserScope, @@ -641,7 +643,8 @@ def main(): window.setVisible(True) window.setAttribute(qt.Qt.WA_DeleteOnClose, True) - result = app.exec_() + result = app.exec() + context.saveSettings() # remove ending warnings relative to QTimer diff --git a/src/pyFAI/app/diff_map.py b/src/pyFAI/app/diff_map.py index 1a472a970..aa69c930d 100755 --- a/src/pyFAI/app/diff_map.py +++ b/src/pyFAI/app/diff_map.py @@ -33,7 +33,7 @@ __contact__ = "Jerome.Kieffer@ESRF.eu" __license__ = "MIT" __copyright__ = "European Synchrotron Radiation Facility, Grenoble, France" -__date__ = "07/10/2025" +__date__ = "21/11/2025" __satus__ = "Production" import sys @@ -70,7 +70,8 @@ def main(args=None): window.set_config(config) # window.restore() window.show() - sys.exit(app.exec_()) + result = app.exec() + sys.exit(result) del context else: dt.configure_worker(config.ai) diff --git a/src/pyFAI/app/drawmask.py b/src/pyFAI/app/drawmask.py index a32e032a1..f59758ddd 100755 --- a/src/pyFAI/app/drawmask.py +++ b/src/pyFAI/app/drawmask.py @@ -33,10 +33,11 @@ __contact__ = "Jerome.Kieffer@ESRF.eu" __license__ = "MIT" __copyright__ = "European Synchrotron Radiation Facility, Grenoble, France" -__date__ = "07/10/2025" +__date__ = "21/11/2025" __satus__ = "Production" import os +import sys import numpy from argparse import ArgumentParser import fabio @@ -182,12 +183,11 @@ def main(args=None): window.setOutputFile(outfile) print("Your mask-file will be saved into %s" % (outfile)) - - app.exec_() + result = app.exec() mask = window.getSelectionMask() postProcessId21(processFile, mask) - + sys.exit(result) if __name__ == "__main__": main() diff --git a/src/pyFAI/app/integrate.py b/src/pyFAI/app/integrate.py index 6904364cb..662e40f51 100755 --- a/src/pyFAI/app/integrate.py +++ b/src/pyFAI/app/integrate.py @@ -33,7 +33,7 @@ __contact__ = "Jerome.Kieffer@ESRF.eu" __license__ = "MIT" __copyright__ = "European Synchrotron Radiation Facility, Grenoble, France" -__date__ = "07/10/2025" +__date__ = "21/11/2025" __satus__ = "production" import sys @@ -109,7 +109,7 @@ def processData(config=None): dialog.setFileMode(qt.QFileDialog.ExistingFiles) moveCenterTo(dialog, center) - result = dialog.exec_() + result = dialog.exec() if not result: return input_data = [str(i) for i in dialog.selectedFiles()] @@ -138,7 +138,7 @@ def run(self): qtProcess = QtProcess() qtProcess.start() - result = dialog.exec_() + result = dialog.exec() if result: qt.QMessageBox.information(dialog, "Integration", @@ -153,7 +153,7 @@ def run(self): window.batchProcessRequested.connect(validateConfig) window.show() - result = app.exec_() + result = app.exec() context.saveSettings() return result diff --git a/src/pyFAI/containers.py b/src/pyFAI/containers.py index 028c3c372..189ed0403 100644 --- a/src/pyFAI/containers.py +++ b/src/pyFAI/containers.py @@ -26,29 +26,24 @@ """Module containing holder classes, like returned objects.""" -__author__ = "Valentin Valls" +__authors__ = ["Valentin Valls", "Jérôme Kieffer"] __contact__ = "valentin.valls@esrf.eu" __license__ = "MIT" __copyright__ = "European Synchrotron Radiation Facility, Grenoble, France" -__date__ = "02/10/2025" +__date__ = "17/11/2025" __status__ = "development" -import sys import copy import logging import warnings -from dataclasses import dataclass as _dataclass, fields as fields, asdict as asdict from typing import NamedTuple from enum import IntEnum -from .utils.decorators import deprecated_warning +from dataclasses import fields, asdict # noqa import numpy from numpy.typing import ArrayLike +from .utils.dataclasses import dataclass, case_insensitive_dataclass # noqa +from .utils.decorators import deprecated_warning -# User defined dataclasses -if sys.version_info >= (3, 10): - dataclass = _dataclass(slots=True) -else: - dataclass = _dataclass logger = logging.getLogger(__name__) diff --git a/src/pyFAI/geometry/core.py b/src/pyFAI/geometry/core.py index e633e16ff..ea93f026b 100644 --- a/src/pyFAI/geometry/core.py +++ b/src/pyFAI/geometry/core.py @@ -2171,7 +2171,7 @@ def make_headers(self, type_="list"): """ res = None if type_ == "dict": - res = self.getPyFAI() + res = self.get_config() else: # type_ == "list": f2d = self.getFit2D() res = [ diff --git a/src/pyFAI/gui/__init__.py b/src/pyFAI/gui/__init__.py index ad9d55329..0a2ecfbdd 100644 --- a/src/pyFAI/gui/__init__.py +++ b/src/pyFAI/gui/__init__.py @@ -1,7 +1,7 @@ # coding: utf-8 # /*########################################################################## # -# Copyright (C) 2016-2018 European Synchrotron Radiation Facility +# Copyright (C) 2016-2025 European Synchrotron Radiation Facility # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -26,4 +26,4 @@ __copyright__ = "European Synchrotron Radiation Facility, Grenoble, France" __license__ = "MIT" -__date__ = "06/03/2018" +__date__ = "21/11/2025" diff --git a/src/pyFAI/gui/dialog/DetectorSelectorDialog.py b/src/pyFAI/gui/dialog/DetectorSelectorDialog.py index 59d3ea4be..ebd18cd9d 100644 --- a/src/pyFAI/gui/dialog/DetectorSelectorDialog.py +++ b/src/pyFAI/gui/dialog/DetectorSelectorDialog.py @@ -25,7 +25,7 @@ __authors__ = ["Valentin Valls", "Jérôme Kieffer"] __license__ = "MIT" -__date__ = "30/10/2025" +__date__ = "21/11/2025" import os import logging @@ -216,7 +216,7 @@ def setSensorConfig(self, sensor: SensorConfig | None = None): with block_signals(self._detectorSensorThickness): if index < 0: self._detectorSensorThickness.addItem( - f"{1e6 * sensor.thickness:4.0f}" if sensor.thickness else "", + f"{1e6 * sensor.thickness:4.0f}" if sensor.thickness else "", userData=sensor.thickness ) index = self._detectorSensorThickness.findData(sensor.thickness) @@ -226,7 +226,7 @@ def setSensorConfig(self, sensor: SensorConfig | None = None): with block_signals(self._detectorSensorMaterials): if index < 0: self._detectorSensorMaterials.addItem( - sensor.material.name if sensor.material else "", + sensor.material.name if sensor.material else "", userData=sensor.material ) index = self._detectorSensorMaterials.findData(sensor.material) @@ -339,7 +339,7 @@ def createSplineDialog(self, title, previousFile): def loadSplineFile(self): previousFile = self.__splineFile.value() dialog = self.createSplineDialog("Load spline image", previousFile=previousFile) - result = dialog.exec_() + result = (dialog).exec() if not result: return filename = dialog.selectedFiles()[0] @@ -410,7 +410,7 @@ def __loadDetectorFormFile(self): dialog = self.createFileDialog( "Load detector from HDF5 file", previousFile=previousFile ) - result = dialog.exec_() + result = (dialog).exec() if not result: return filename = dialog.selectedFiles()[0] diff --git a/src/pyFAI/gui/dialog/MessageBox.py b/src/pyFAI/gui/dialog/MessageBox.py index 5e4f674cf..7255cb4b9 100644 --- a/src/pyFAI/gui/dialog/MessageBox.py +++ b/src/pyFAI/gui/dialog/MessageBox.py @@ -1,7 +1,7 @@ # coding: utf-8 # /*########################################################################## # -# Copyright (C) 2016-2018 European Synchrotron Radiation Facility +# Copyright (C) 2016-2025 European Synchrotron Radiation Facility # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -23,9 +23,9 @@ # # ###########################################################################*/ -__authors__ = ["V. Valls"] +__authors__ = ["V. Valls", "Jérôme Kieffer"] __license__ = "MIT" -__date__ = "16/10/2020" +__date__ = "21/11/2025" import logging import sys @@ -72,4 +72,4 @@ def exception(parent, title, exc_info, logger=None): msg.setDetailedText(detailed) msg.raise_() - msg.exec_() + (msg).exec() diff --git a/src/pyFAI/gui/diffmap_widget.py b/src/pyFAI/gui/diffmap_widget.py index 0bda29c96..6c86343ee 100644 --- a/src/pyFAI/gui/diffmap_widget.py +++ b/src/pyFAI/gui/diffmap_widget.py @@ -30,7 +30,7 @@ __contact__ = "Jerome.Kieffer@ESRF.eu" __license__ = "MIT" __copyright__ = "European Synchrotron Radiation Facility, Grenoble, France" -__date__ = "14/05/2025" +__date__ = "21/11/2025" __status__ = "development" __docformat__ = 'restructuredtext' @@ -310,7 +310,7 @@ def configure_diffraction(self, *arg, **kwarg): if self.integration_config is not None: iw.widget.setWorkerConfig(self.integration_config) while True: - res = iw.exec_() + res = (iw).exec() if res == qt.QDialog.Accepted: self.integration_config = iw.widget.getWorkerConfig() if self.integration_config.nbpt_rad: diff --git a/src/pyFAI/gui/tasks/ExperimentTask.py b/src/pyFAI/gui/tasks/ExperimentTask.py index 2d6e1c6ed..1ee653f56 100644 --- a/src/pyFAI/gui/tasks/ExperimentTask.py +++ b/src/pyFAI/gui/tasks/ExperimentTask.py @@ -25,7 +25,7 @@ __authors__ = ["Valentin Valls", "Jérôme Kieffer"] __license__ = "MIT" -__date__ = "07/11/2025" +__date__ = "21/11/2025" import numpy import logging @@ -145,7 +145,7 @@ def __display3dDialog(self): dialog.setData(detector=detector, image=image, mask=mask, colormap=colormap, geometry=None) - dialog.exec_() + (dialog).exec() def _updateModel(self, model): self.__synchronizeRawView.registerModel(model.rawPlotView()) @@ -235,7 +235,7 @@ def __customDetector(self): detector = settings.detectorModel().detector() dialog = DetectorSelectorDialog(self) dialog.selectDetector(detector) - result = dialog.exec_() + result = (dialog).exec() if result and dialog.selectedDetector(): newDetector = dialog.selectedDetector() settings.detectorModel().setDetector(newDetector) @@ -449,7 +449,7 @@ def createCalibrantDialog(self, title): def loadCalibrant(self): dialog = self.createCalibrantDialog("Load calibrant file") - result = dialog.exec_() + result = (dialog).exec() if not result: return diff --git a/src/pyFAI/gui/tasks/GeometryTask.py b/src/pyFAI/gui/tasks/GeometryTask.py index c64344622..6d876f1a0 100644 --- a/src/pyFAI/gui/tasks/GeometryTask.py +++ b/src/pyFAI/gui/tasks/GeometryTask.py @@ -23,9 +23,9 @@ # # ###########################################################################*/ -__authors__ = ["V. Valls"] +__authors__ = ["V. Valls", "Jérôme Kieffer"] __license__ = "MIT" -__date__ = "31/10/2025" +__date__ = "21/11/2025" import logging import numpy @@ -34,9 +34,10 @@ from silx.gui import qt from silx.gui import icons import silx.gui.plot +from silx.image import marchingsquares -import pyFAI.utils -from pyFAI.utils import stringutil +from ... import utils as pyFAI_utils +from ...utils import stringutil from .AbstractCalibrationTask import AbstractCalibrationTask from ..helper.RingCalibration import RingCalibration from ..helper.SynchronizeRawView import SynchronizeRawView @@ -54,7 +55,6 @@ from ...geometry import fit2d from ...io.ponifile import PoniFile -from silx.image import marchingsquares _logger = logging.getLogger(__name__) @@ -561,7 +561,7 @@ def setProcessing(self): class GeometryTask(AbstractCalibrationTask): def _initGui(self): - qt.loadUi(pyFAI.utils.get_ui_file("calibration-geometry.ui"), self) + qt.loadUi(pyFAI_utils.get_ui_file("calibration-geometry.ui"), self) icon = icons.getQIcon("pyfai:gui/icons/task-fit-geometry") self.setWindowIcon(icon) @@ -1123,4 +1123,4 @@ def __display3dDialog(self): dialog.setData(detector=detector, image=image, mask=mask, colormap=colormap, geometry=geometry) - dialog.exec_() + (dialog).exec() diff --git a/src/pyFAI/gui/tasks/IntegrationTask.py b/src/pyFAI/gui/tasks/IntegrationTask.py index 584f12da0..16d88cac8 100644 --- a/src/pyFAI/gui/tasks/IntegrationTask.py +++ b/src/pyFAI/gui/tasks/IntegrationTask.py @@ -25,7 +25,7 @@ __authors__ = ["V. Valls", "J. Kieffer"] __license__ = "MIT" -__date__ = "03/11/2025" +__date__ = "21/11/2025" import logging import numpy @@ -759,7 +759,7 @@ def __plot2dContextMenu(self, pos): menu.addAction(action) handle = self.__plot2d.getWidgetHandle() - menu.exec_(handle.mapToGlobal(pos)) + (menu).exec(handle.mapToGlobal(pos)) def __clearRings(self): """Remove of ring item cached on the plots""" @@ -893,7 +893,7 @@ def __saveAsCsv(self): if self.__result1d is None: return dialog = createSaveDialog(self, "Save 1D integration as CSV file", csv=True) - result = dialog.exec_() + result = (dialog).exec() if not result: return filename = dialog.selectedFiles()[0] @@ -961,7 +961,7 @@ def _initGui(self): def __customIntegrationMethod(self): dialog = IntegrationMethodDialog(self) dialog.selectMethod(self.__method) - result = dialog.exec_() + result = (dialog).exec() if result: method = dialog.selectedMethod() self.__setMethod(method) @@ -1123,7 +1123,7 @@ def __saveAsPoni(self): if previousPoniFile is not None: dialog.selectFile(previousPoniFile) - result = dialog.exec_() + result = (dialog).exec() if not result: return filename = dialog.selectedFiles()[0] @@ -1157,7 +1157,7 @@ def __saveJsonFile(self): if previousJsonFile is not None: dialog.selectFile(previousJsonFile) - result = dialog.exec_() + result = (dialog).exec() if not result: return filename = dialog.selectedFiles()[0] diff --git a/src/pyFAI/gui/tasks/PeakPickingTask.py b/src/pyFAI/gui/tasks/PeakPickingTask.py index eca288e68..716b77dbc 100644 --- a/src/pyFAI/gui/tasks/PeakPickingTask.py +++ b/src/pyFAI/gui/tasks/PeakPickingTask.py @@ -25,7 +25,7 @@ __authors__ = ["V. Valls"] __license__ = "MIT" -__date__ = "19/01/2024" +__date__ = "21/11/2025" import logging import numpy @@ -1144,7 +1144,7 @@ def __createLoadPeakDialog(self): def __loadPeaksFromFile(self): dialog = self.__createLoadPeakDialog() - result = dialog.exec_() + result = (dialog).exec() if not result: return @@ -1169,7 +1169,7 @@ def __loadPeaksFromFile(self): def __savePeaksAsFile(self): dialog = self.__createSavePeakDialog() - result = dialog.exec_() + result = (dialog).exec() if not result: return diff --git a/src/pyFAI/gui/utils/__init__.py b/src/pyFAI/gui/utils/__init__.py index 36e35767a..d8a5e6703 100644 --- a/src/pyFAI/gui/utils/__init__.py +++ b/src/pyFAI/gui/utils/__init__.py @@ -34,7 +34,7 @@ __contact__ = "Jerome.Kieffer@ESRF.eu" __license__ = "MIT" __copyright__ = "European Synchrotron Radiation Facility, Grenoble, France" -__date__ = "30/10/2025" +__date__ = "17/11/2025" __status__ = "production" @@ -85,4 +85,3 @@ def maximize_fig(fig=None): except TypeError: mng.resize(*win_shape) update_fig(fig) - diff --git a/src/pyFAI/gui/widgets/LoadImageToolButton.py b/src/pyFAI/gui/widgets/LoadImageToolButton.py index 8d6a5d75b..0f3fb244d 100644 --- a/src/pyFAI/gui/widgets/LoadImageToolButton.py +++ b/src/pyFAI/gui/widgets/LoadImageToolButton.py @@ -1,7 +1,7 @@ # coding: utf-8 # /*########################################################################## # -# Copyright (C) 2016-2024 European Synchrotron Radiation Facility +# Copyright (C) 2016-2025 European Synchrotron Radiation Facility # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -23,9 +23,9 @@ # # ###########################################################################*/ -__authors__ = ["V. Valls"] +__authors__ = ["V. Valls", "Jérôme Kieffer"] __license__ = "MIT" -__date__ = "29/01/2024" +__date__ = "21/11/2025" import fabio import os @@ -69,7 +69,7 @@ def __execute(self): dialog.setModal(True) dialog.setFileMode(qt.QFileDialog.ExistingFile) - result = dialog.exec_() + result = (dialog).exec() if result: filename = dialog.selectedFiles()[0] if self.parent()._isDataSupported(): @@ -107,7 +107,7 @@ def __execute(self): dialog.setWindowTitle(self.parent().dialogTitle()) dialog.setModal(True) - result = dialog.exec_() + result = (dialog).exec() if result: url = dialog.selectedUrl() data = dialog.selectedImage() diff --git a/src/pyFAI/gui/widgets/WorkerConfigurator.py b/src/pyFAI/gui/widgets/WorkerConfigurator.py index 120302851..9c5789eb9 100644 --- a/src/pyFAI/gui/widgets/WorkerConfigurator.py +++ b/src/pyFAI/gui/widgets/WorkerConfigurator.py @@ -33,7 +33,7 @@ __contact__ = "Jerome.Kieffer@ESRF.eu" __license__ = "MIT" __copyright__ = "European Synchrotron Radiation Facility, Grenoble, France" -__date__ = "18/02/2025" +__date__ = "21/11/2025" __status__ = "development" import logging @@ -465,7 +465,7 @@ def getOpenFileName(self, title): dialog.setModal(True) dialog.setFileMode(qt.QFileDialog.ExistingFile) - result = dialog.exec_() + result = (dialog).exec() if not result: return None @@ -475,7 +475,7 @@ def getOpenFileName(self, title): def selectDetector(self): dialog = DetectorSelectorDialog(self) dialog.selectDetector(self.__detector) - result = dialog.exec_() + result = (dialog).exec() if result: newDetector = dialog.selectedDetector() self.setDetector(newDetector) @@ -496,7 +496,7 @@ def selectGeometry(self): dialog = GeometryDialog(self) dialog.setGeometryModel(self.__geometryModel) dialog.setDetector(self.__detector) - result = dialog.exec_() + result = (dialog).exec() if result: geometry = dialog.geometryModel() if geometry.isValid(checkWaveLength=False): @@ -507,7 +507,7 @@ def selectGeometry(self): def selectOpenclDevice(self): dialog = OpenClDeviceDialog(self) dialog.selectDevice(self.__openclDevice) - result = dialog.exec_() + result = (dialog).exec() if result: device = dialog.device() self.__setOpenclDevice(device) @@ -515,7 +515,7 @@ def selectOpenclDevice(self): def selectMethod(self): dialog = IntegrationMethodDialog(self) dialog.selectMethod(self.__method) - result = dialog.exec_() + result = (dialog).exec() if result: method = dialog.selectedMethod() dim = 2 if self.do_2D.isChecked() else 1 @@ -545,7 +545,7 @@ def __selectFile(self): builder.addFileFormat("JSON files", "json") dialog.setNameFilters(builder.getFilters()) - result = dialog.exec_() + result = (dialog).exec() if not result: return @@ -568,7 +568,7 @@ def __savePoni(self): # builder.addFileFormat("JSON files", "json") dialog.setNameFilters(builder.getFilters()) - result = dialog.exec_() + result = (dialog).exec() if not result: return