

def _finish_sumatra(self):
    ' Saves a sumatra record '
    finish_time = (self._start_timestamp - self._finish_timestamp)
    self._sumatra_record.duration = finish_time
    self._sumatra_record.output_data = self._sumatra_record.datastore.find_new_data(self._sumatra_record.timestamp)
    self._loaded_sumatatra_project.add_record(self._sumatra_record)
    self._loaded_sumatatra_project.save()
    sumatra_label = self._sumatra_record.label
    config_name = ('sumatra.record_%s.label' % str(sumatra_label))
    conf_list = []
    if (not self._traj.f_contains(('config.' + config_name))):
        conf1 = self._traj.f_add_config(Parameter, config_name, str(sumatra_label), comment='The label of the sumatra record')
        conf_list.append(conf1)
    if self._sumatra_reason:
        config_name = ('sumatra.record_%s.reason' % str(sumatra_label))
        if (not self._traj.f_contains(('config.' + config_name))):
            conf2 = self._traj.f_add_config(Parameter, config_name, str(self._sumatra_reason), comment='Reason of sumatra run.')
            conf_list.append(conf2)
    if (self._automatic_storing and conf_list):
        self._traj.f_store_items(conf_list)
    self._logger.info(('Saved sumatra project record with reason: %s' % str(self._sumatra_reason)))

dataset/ETHPy150Open SmokinCaterpillar/pypet/pypet/environment.py Environment._finish_sumatra/original