def check_positive_integer(value, parameter_name='value'):
    """This function checks whether the given value is a positive integer.

    Parameters
    ----------
    value: numeric,
        Value to check.
    parameter_name: str,
        The name of the indices array, which is printed in case of error.

    Returns
    -------
    value: int,
        Checked and converted int.
    """
    int_value = int(value)
    if value < 0 or value != int_value:
        raise ValueError('The parameter `' + str(parameter_name) + '` must be a positive integer.')
    return value