I had the idea to make allow_overlap=False work differently internally. Why don't we first generate the intervals, and then throw out anchor years if there is overlap. This avoids having to do complex calculations when working with non-day Timedeltas.
For the plotting utilities we already require a get_overlapping_periods method on the calendar anyway (to display which intervals overlap).
Of course this makes generating the calendar a bit slower, but I don't think the calendar generation will ever be a bottleneck. On the upside; it makes our code a lot simpler.
I had the idea to make
allow_overlap=False
work differently internally. Why don't we first generate the intervals, and then throw out anchor years if there is overlap. This avoids having to do complex calculations when working with non-day Timedeltas. For the plotting utilities we already require aget_overlapping_periods
method on the calendar anyway (to display which intervals overlap).Some pseudocode:
Of course this makes generating the calendar a bit slower, but I don't think the calendar generation will ever be a bottleneck. On the upside; it makes our code a lot simpler.