def test_build_activity_log(person_heh): population = Population() for i in range(5): hh = Household(i) hh.add(person_heh) population.add(hh) log = extract_activity_log(population) assert len(log) == 15 assert list(log.columns) == ['act', 'start', 'end', 'duration']
def test_time_binner(person_heh): population = Population() for i in range(5): hh = Household(i) hh.add(person_heh) population.add(hh) log = extract_activity_log(population) binned = time_binner(log) assert len(binned) == 96 for h in ['start', 'end', 'duration']: assert binned[h].sum() == 3