Split a period into a given granularity. Optionally include partial
        periods at the start and end of the period.

def split(self, granularity_after_split, exclude_partial=True):
        """
        Split a period into a given granularity. Optionally include partial
        periods at the start and end of the period.
        """

        if granularity_after_split == Granularity.DAY:
            return self.get_days()

        elif granularity_after_split == Granularity.WEEK:
            return self.get_weeks(exclude_partial)

        elif granularity_after_split == Granularity.MONTH:
            return self.get_months(exclude_partial)

        elif granularity_after_split == Granularity.QUARTER:
            return self.get_quarters(exclude_partial)

        elif granularity_after_split == Granularity.HALF_YEAR:
            return self.get_half_years(exclude_partial)

        elif granularity_after_split == Granularity.YEAR:
            return self.get_years(exclude_partial)

        else:
            raise Exception("Invalid granularity: %s" % granularity_after_split)