def validate_sp(sp):
    """Validate seasonal periodicity.

    Parameters
    ----------
    sp : int
        Seasonal periodicity

    Returns
    -------
    sp : int
        Validated seasonal periodicity
    """

    if sp is None:
        return sp

    else:
        if not isinstance(sp, int) and (sp >= 0):
            raise ValueError(f"Seasonal periodicity (sp) has to be a positive integer, but found: "
                             f"{sp} of type: {type(sp)}")
        return sp