silx icon indicating copy to clipboard operation
silx copied to clipboard

Problem with matplotlib backend on windows on upgrade from mpl 3.5.3 to 3.6.0

Open sbillinge opened this issue 3 years ago • 4 comments
trafficstars

This bug occurred when trying to run pyfai-calib2 on windows (git bash and cmd terminals) with matplotlib 3.6.0. It runs fine with 3.5.3. The stack dump is below. @tacaswell asked to be at'ed.

Instead of opening an interactive gui window with a matplotlib plot of data in it, it crashed with this:

$ pyfai-calib2 example_data/Ni.tiff
INFO:numexpr.utils:NumExpr defaulting to 4 threads.
WARNING:silx.DEPRECATION:module C:\Users\simon\miniconda3\envs\pyfai\lib\site-packages\silx\gui\plot\matplotlib\__init__.py is deprecated since silx version 0.14.0. Use 'silx.gui.utils.matplotlib' instead.
  File "C:\Users\simon\miniconda3\envs\pyfai\lib\site-packages\silx\gui\plot\matplotlib\__init__.py", line 32, in <module>
    deprecated_warning(type_='module',
INFO:pyFAI.method_registry:Degrading method from Method(dim=1, split='pseudo', algo='histogram', impl='*', target=None) -> Method(dim=1, split='bbox', algo='histogram', impl='*', target=None)
ERROR:pyFAI-calib2.UNCAUGHT:__init__() missing 1 required positional argument: 'plot'
Traceback (most recent call last):
  File "C:\Users\simon\miniconda3\envs\pyfai\Scripts\pyfai-calib2-script.py", line 10, in <module>
    sys.exit(main())
  File "C:\Users\simon\miniconda3\envs\pyfai\lib\site-packages\pyFAI\app\calib2.py", line 594, in main
    window = CalibrationWindow(context)
  File "C:\Users\simon\miniconda3\envs\pyfai\lib\site-packages\pyFAI\gui\CalibrationWindow.py", line 152, in __init__
    self.__tasks = self.createTasks()
  File "C:\Users\simon\miniconda3\envs\pyfai\lib\site-packages\pyFAI\gui\CalibrationWindow.py", line 259, in createTasks
    ExperimentTask(),
  File "C:\Users\simon\miniconda3\envs\pyfai\lib\site-packages\pyFAI\gui\tasks\AbstractCalibrationTask.py", line 46, in __init__
    self._initGui()
  File "C:\Users\simon\miniconda3\envs\pyfai\lib\site-packages\pyFAI\gui\tasks\ExperimentTask.py", line 70, in _initGui
    self.__plot = self.__createPlot(parent=self._imageHolder)
  File "C:\Users\simon\miniconda3\envs\pyfai\lib\site-packages\pyFAI\gui\tasks\ExperimentTask.py", line 96, in __createPlot
    plot = silx.gui.plot.PlotWidget(parent=parent)
  File "C:\Users\simon\miniconda3\envs\pyfai\lib\site-packages\silx\gui\plot\PlotWidget.py", line 391, in __init__
    self._backend = self.__getBackendClass(backend)(self, self)
  File "C:\Users\simon\miniconda3\envs\pyfai\lib\site-packages\silx\gui\plot\backends\BackendMatplotlib.py", line 1339, in __init__
    FigureCanvasQTAgg.__init__(self, self.fig)
  File "C:\Users\simon\miniconda3\envs\pyfai\lib\site-packages\matplotlib\backends\backend_qt.py", line 209, in __init__
    super().__init__(figure=figure)
  File "C:\Users\simon\miniconda3\envs\pyfai\lib\site-packages\matplotlib\backend_bases.py", line 1656, in __init__
    super().__init__()  # Typically the GUI widget init (if any).
TypeError: __init__() missing 1 required positional argument: 'plot'

sbillinge avatar Oct 04 '22 15:10 sbillinge

It is a duplicate of #3684

Current master already corrects the issue

https://github.com/silx-kit/silx/pull/3639

vasole avatar Oct 04 '22 16:10 vasole

@tacaswell The fix was https://github.com/silx-kit/silx/commit/e40f5aa3cbf74a51e9520d46d4538ed36faca0a3

vasole avatar Oct 04 '22 16:10 vasole

Ah, great! Sorry we broke you from the mpl side, but glad you caught this with the pre-release.

tacaswell avatar Oct 04 '22 16:10 tacaswell

We caught it quickly but we are slow to release..

We made a pre-release with the fix: https://pypi.org/project/silx/1.1.0rc0/, the release should follow soon.

t20100 avatar Oct 20 '22 13:10 t20100

This is fixed in latest release 1.1.0

t20100 avatar Nov 08 '22 13:11 t20100