def _calculate_particle_index_starts(self):
    particle_count = defaultdict(int)
    offset_count = 0
    for data_file in self.data_files:
        data_file.index_start = dict([(ptype, particle_count[ptype]) for ptype in data_file.total_particles])
        data_file.offset_start = offset_count
        for ptype in data_file.total_particles:
            particle_count[ptype] += data_file.total_particles[ptype]
        offset_count += data_file.total_offset
def _calculate_particle_index_starts(self):
    particle_count = defaultdict(int)
    offset_count = 0
    for data_file in self.data_files:
        data_file.index_start = dict([(ptype, particle_count[ptype]) for ptype in data_file.total_particles])
        data_file.offset_start = offset_count
        for ptype in data_file.total_particles:
            particle_count[ptype] += data_file.total_particles[ptype]
        offset_count += data_file.total_offset