def METHOD_NAME():
    """
    Test that the errors are correctly captured in the aggregate_fields
    function.
    """
    data = np.arange(4 * 6).reshape(4, 6)
    with raises(ValueError):
        dimension.aggregate_fields(data, -1, axis=0)
    with raises(ValueError):
        dimension.aggregate_fields(data, 0, axis=0)
    with raises(ValueError):
        dimension.aggregate_fields(data, 1, method="invalid")
    with raises(TypeError):
        dimension.aggregate_fields(data, (1, 1), axis=0)