

def _execute_postproc(self, results):
    ' Executes a postprocessing function\n\n        :param results:\n\n            List of tuples containing the run indices and the results\n\n        :return:\n\n            1. Whether to new single runs, since the trajectory was enlarged\n            2. Index of next new run\n            3. Number of new runs\n\n        '
    repeat = False
    start_run_idx = 0
    new_runs = 0
    self._traj._finalize(store_meta_data=True)
    old_traj_length = len(self._traj)
    postproc_res = self._postproc(self._traj, results, *self._postproc_args, **self._postproc_kwargs)
    if (postproc_res is None):
        pass
    elif isinstance(postproc_res, dict):
        if postproc_res:
            self._traj.f_expand(postproc_res)
    elif isinstance(postproc_res, tuple):
        expand_dict = postproc_res[0]
        if (len(postproc_res) > 1):
            self._args = postproc_res[1]
        if (len(postproc_res) > 2):
            self._kwargs = postproc_res[2]
        if (len(postproc_res) > 3):
            self._postproc_args = postproc_res[3]
        if (len(postproc_res) > 4):
            self._postproc_kwargs = postproc_res[4]
        if expand_dict:
            self._traj.f_expand(expand_dict)
    else:
        self._logger.error(('Your postproc result `%s` was not understood.' % str(postproc_res)))
    new_traj_length = len(self._traj)
    if (new_traj_length != old_traj_length):
        start_run_idx = old_traj_length
        repeat = True
        if self._resumable:
            self._logger.warning('Continuing a trajectory AND expanding it during runtime is NOT supported properly, there is no guarantee that this works!')
        self._traj.f_store(only_init=True)
        new_traj_length = len(self._traj)
        new_runs = (new_traj_length - old_traj_length)
    return (repeat, start_run_idx, new_runs)

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