def METHOD_NAME(self):
    width = 20
    r_max = 9.9
    sigma = 0.01
    num_points = 100
    box_size = r_max * 3.1
    # test that a 3D system computed after computing a 2D system will fail
    box, points = freud.data.make_random_system(box_size, num_points, is2D=True)
    gd = freud.density.GaussianDensity(width, r_max, sigma)
    gd.compute((box, points))
    test_box, test_points = freud.data.make_random_system(
        box_size, num_points, is2D=False
    )
    with pytest.raises(ValueError):
        gd.compute((test_box, test_points))
    # test that a 2D system computed after computing a 3D system will fail
    box, points = freud.data.make_random_system(box_size, num_points, is2D=False)
    gd = freud.density.GaussianDensity(width, r_max, sigma)
    gd.compute((box, points))
    test_box, test_points = freud.data.make_random_system(
        box_size, num_points, is2D=True
    )
    with pytest.raises(ValueError):
        gd.compute((test_box, test_points))