ankane/groupdate — pull request #42 by helloenvoy (2014-04-25 09:37:43+00:00)
Title: add month_start day feature to monthly grouping

Here's my attempt to resolve #40. It includes a bunch of tests to make sure it works with time zones and day_start offsets. It also is not triggered start day of the month is > 1, because I suspect it could significantly affect database performance

There is one little idiosyncrasy in the behavior that you can see in one of the tests. When using a month_start value beyond the last day of the month, the grouped values are rounded to that last day of that month (so we always have one point per month). For example, if your month_start day is 31, data in May prior to the 31st will end up grouped on 4/30. When the Series object sees this, it repeats the rounding step and determines the series must begin on 3/30 (since that would normally be the rounded date for an original datapoint on 4/30) and so it generates an extra empty data point. I'm not quite sure what the right way to address this is and whether it's really a deal-breaker. I'd love some feedback about this since I'm not completely clear on what the Series object is used for (in my code, I set series: false).

I also wonder if being able to set a month_start day of something like 3rd Tuesday might ultimately be more useful. Maybe this can be a starting off point for that.

Cheers,

Andrew