AdvancedPhotonSource / GSAS-II

Home for GSAS-II: crystallographic and diffraction-based structural characterization of materials
Other
29 stars 10 forks source link

matplotlib=3.8.4 `Ellipse` function redefinition #22

Closed niklasbt closed 4 months ago

niklasbt commented 4 months ago

When attempting to calibrate data from a Ni standard, GSASIIplot.py flags a TypeError: Ellipse.__init__() takes 4 positional arguments but 5 were given when trying to call Plot.add_artist() on line 8985.

This issue seems to be due to a redefinition of matplotlib.patches.Ellipse where angle is no longer a positional argument but a keyword argument (at least, it appears after * and must now be called as a keyword). I have verified that updating line 8985 of GSASIIplot.py with:

Plot.add_artist(Ellipse([cent[0],cent[1]],2*width,2*height,angle=phi,ec=col,fc='none'))

corrects the issue.

For completeness, here is the GSAS-II configuration:

Python/module versions loaded:
  Python:     3.11.9  from /Users/niklas/opt/gsas2full/GSAS-II/GSAS-II.app/Contents/MacOS/GSAS-II. 
  wx:         4.2.1  
  matplotlib: 3.8.4  
  numpy:      1.26.4  
  scipy:      1.13.0  
  OpenGL:     3.1.6  
  Image:      10.3.0 (PIL or Pillow)
  Platform:   darwin 64bit arm64
  GSAS-II:    b26156 from 20-May-2024 14:49 (0.1 days old). Version: last tag #5788
MIDAS_Zarr Reader skipped because zarr module is not installed
briantoby commented 4 months ago

Addressed with 7d6814da.

@niklasbt It would be very much appreciated if you could test this. Thanks for reporting this. Even more for providing a fix.

niklasbt commented 4 months ago

Addressed with 7d6814d.

@niklasbt It would be very much appreciated if you could test this. Thanks for reporting this. Even more for providing a fix.

@briantoby I updated to 7d6814 and this has fixed the issue for me. Thanks for your quick attention!