Closed llimeht closed 2 years ago
Since SasView explicitly specifies matplotlib 3.4.3 I wouldn't consider this a bug. That said, if the changes you suggest make it 3.5 compatible it would be a good thing. There was some discussion about matplotlib versions before I joined the project, and I'm not 100% about the decisions made. Maybe post your suggested changes as a pull request?
Coincidentally 4 days ago I was made aware that the colour map widget on 2D plots was not working in the version of 5.0.5 on our IDAaaS system (running on CentOS). The following is reported:
15:28:07 - ERROR: Traceback (most recent call last):
File "/opt/sasview5/lib/python3.10/site-packages/sas/qtgui/Plotting/Plotter2D.py", line 431, in onColorMap
color_map_dialog = ColorMap(self, cmap=self.cmap,
File "/opt/sasview5/lib/python3.10/site-packages/sas/qtgui/Plotting/ColorMap.py", line 48, in __init__
self.initRangeSlider()
File "/opt/sasview5/lib/python3.10/site-packages/sas/qtgui/Plotting/ColorMap.py", line 159, in initRangeSlider
self.slider.setMinimum(self.vmin)
TypeError: setMinimum(self, int): argument 1 has unexpected type 'numpy.float64'
I suspect this may be a MPL version issue too.
Unfortunately I'm struggling to unambiguously identify which version of 5.0.5 is installed on the IDAaaS production server (and even the Support Team are now confused!), the rc2 pre-release or the 5.0.5 release. The About box just says Git Commit, but that may be a red herring?
Anyone got a bright idea?
Anyone got a bright idea?
Not really bright but I don't think we support python 3.10 yet? At least we should try running the dev version on 3.10 and seeing how much effort it takes to port/update it.
Update: Ok, so IDAaaS Support are now sure that the widget traceback above was from the release version of 5.0.5 installed from conda-forge.
the git commit in the "about" should probably be removed now that we are using versioning better? It was originally meant to be followed by the commit hash but only worked I think on one OS? and maybe only way way back at the dawn of time? As far as I know it has not worked for yonks and is thus useless -- unless somebody knows how to fix it.
Coincidentally 4 days ago...
You should be making a new issue for things that are only tangentially related to the issue at hand.
@lucas-wilkins #2213 now exists; with it applied I was at least able to start sasview with mpl 3.5 which meant that I then found some Qt-related problems that are #2214.
I can't promise that's all of the problems with making sasview run with up-to-date versions of those packages, but it's a start that at least gets it as far as being testable. In the testing I did, it was now on a par with mpl 3.4.
Cool, thanks, I'll take a look when I'm back at work
Describe the bug SasView is not compatible with currently supported versions of matplotlib such as the current 3.5.4 release. One symptom of this is seen in #1981 where the GUI closes during initialisation. There are others. Some of these might be picked up by
GUITests.py
but as they don't pass (#1732) their failures on CI don't help spot these issues in advance.To Reproduce Steps to reproduce the behavior:
SasView's attempts to handle the exceptions obfuscate where it is from:
While the error looks to be in
MainWindow.py
the issue is actually thatsas/qtgui/Plotting/Arrow3D.py
needs to be updated to the new 3.5 API.Poking matplotlib compatibility further,
sas/qtgui/Plotting/Plotter2D.py
also seems to need an update for the matplotlib API ascolorbar.update_bruteforce
has now been removed (and had been deprecated for some years).SasView version (please complete the following information):
Operating system (please complete the following information):
Additional context
The following patch at least allows sasview to run with mpl 3.5.4. I can't attest to the correctness of what it is doing to the Arrow3D class beyond (a) it let the main GUI actually render, and (b) the general scattering calculator, which is where this class is used, still displayed some arrows on the plots.