@staticmethod
def handle_leap_ti(ti, drop_leap=False):
    """Handle a time index for a leap year by dropping a day.

        Parameters
        ----------
        ti : pandas.DatetimeIndex
            Time-series datetime index with or without a leap day.
        drop_leap : bool
            Option to drop leap day (if True) or drop the last day of the year
            (if False).

        Returns
        -------
        ti : pandas.DatetimeIndex
            Time-series datetime index with length a multiple of 365.
        """
    leap_day = (ti.month == 2) & (ti.day == 29)
    last_day = (ti.month == 12) & (ti.day == 31)
    if drop_leap:
        ti = ti.drop(ti[leap_day])
    elif any(leap_day):
        ti = ti.drop(ti[last_day])
    if len(ti) % 365 != 0:
        raise ValueError('Bad time index with length not a multiple of 365: {}'
            .format(ti))
    return ti
