glotzerlab / freud

Powerful, efficient particle trajectory analysis in scientific Python.
https://freud.readthedocs.io
BSD 3-Clause "New" or "Revised" License
280 stars 49 forks source link

`TestDiffractionPattern.test_attribute_shapes` fails with matplotlib 3.9.0 #1269

Closed doronbehar closed 4 months ago

doronbehar commented 4 months ago

Description

=================================== FAILURES ===================================
_________________ TestDiffractionPattern.test_attribute_shapes _________________

self = <test_diffraction_DiffractionPattern.TestDiffractionPattern object at 0x7fff6d9be840>

    def test_attribute_shapes(self):
        grid_size = 234
        output_size = 123
        dp = freud.diffraction.DiffractionPattern(
            grid_size=grid_size, output_size=output_size
        )
        box, positions = freud.data.UnitCell.fcc().generate_system(4)
        dp.compute((box, positions))

        assert dp.diffraction.shape == (output_size, output_size)
        assert dp.k_values.shape == (output_size,)
        assert dp.k_vectors.shape == (output_size, output_size, 3)
>       assert dp.to_image().shape == (output_size, output_size, 4)

tests/test_diffraction_DiffractionPattern.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

>   ???
E   AttributeError: module 'matplotlib.cm' has no attribute 'get_cmap'

diffraction.pyx:894: AttributeError

Steps to Reproduce

Build freud with matplotlib 3.9.0

Error Output

Above.

freud Version

3.1.0

Python Version

3.12

System Platform

Linux

Installation method

built from source

Developer

None

joaander commented 4 months ago

This is already tested, fixed, and merged: #1265