cctbx / cctbx_project

Computational Crystallography Toolbox
https://cci.lbl.gov/docs/cctbx
Other
218 stars 116 forks source link

Use `mpl.plt.get_cmap` instead of deprecated `mpl.cm.get_cmap` #897

Closed Baharis closed 1 year ago

Baharis commented 1 year ago

In cctbx.xfel, the matplotlib colormaps are sometimes accessed using matplotlib.cm.get_cmap, which is deprecated starting from matplotlib version 3.7, see issue #894. This PR replaces these calls with a supported equivalent plt.get_cmap.

Furthermore, while browsing for colormap usage in cctbx, I have found multiple instances of colormaps being accessed directly, e.g. matplotlib.cm.jet. This way of accessing colormaps works in maplotlib 3.7 without raising a warning. I asked the developers whether this interface is expected to stay and currently left this code as-is.

bkpoon commented 1 year ago

The Windows failures can be ignored.