Add test for empty data in PeriodGroupedData

If an empty data array is passed to a query with a duration parameter,
currently we get a Python exception. This fixes that error.