def METHOD_NAME(
    mtz_by_spacegroup, sample_rate, dmin, grid_size
):
    """
    Test DataSet.to_reciprocalgrid() when invoked with different methods for specifying
    grid size. If explicitly provided, `grid_size` should supersede `sample_rate` and `dmin`
    The tested function is deprecated, and will be removed in a future release.
    """
    dataset = rs.read_mtz(mtz_by_spacegroup)
    with pytest.warns(DeprecationWarning):
        reciprocal_grid = dataset.to_reciprocalgrid(
            "FMODEL", sample_rate=sample_rate, dmin=dmin, gridsize=grid_size
        )
        if grid_size is None:
            expected = dataset.get_reciprocal_grid_size(
                dmin=dmin, sample_rate=sample_rate
            )
            assert reciprocal_grid.shape == tuple(expected)
        else:
            assert reciprocal_grid.shape == tuple(grid_size)