

def _prepare_runs(self, pipeline):
    'Prepares the running of an experiment\n\n        :param pipeline:\n\n            A pipeline function that defines the task\n\n        '
    pip_result = pipeline(self._traj)
    raise_error = False
    if (pip_result is None):
        if self._do_single_runs:
            raise RuntimeError('Your pipeline function did return `None`.Accordingly, I assume you just do data analysis. Please create and environment with `do_single_runs=False`.')
        self._logger.info('Your pipeline returned no runfunction, I assume you do some sort of data analysis and will skip any single run execution.')
        self._runfunc = None
        return
    elif ((len(pip_result) == 2) and isinstance(pip_result[0], tuple) and isinstance(pip_result[1], tuple)):
        run_tuple = pip_result[0]
        self._runfunc = run_tuple[0]
        if (len(run_tuple) > 1):
            self._args = run_tuple[1]
        if (len(run_tuple) > 2):
            self._kwargs = run_tuple[2]
        if (len(run_tuple) > 3):
            raise_error = True
        postproc_tuple = pip_result[1]
        if (len(postproc_tuple) > 0):
            self._postproc = postproc_tuple[0]
        if (len(postproc_tuple) > 1):
            self._postproc_args = postproc_tuple[1]
        if (len(postproc_tuple) > 2):
            self._postproc_kwargs = postproc_tuple[2]
        if (len(run_tuple) > 3):
            raise_error = True
    elif (len(pip_result) <= 3):
        self._runfunc = pip_result[0]
        if (len(pip_result) > 1):
            self._args = pip_result[1]
        if (len(pip_result) > 2):
            self._kwargs = pip_result[2]
    else:
        raise_error = True
    if raise_error:
        raise RuntimeError('Your pipeline result is not understood please returna tuple of maximum length 3: ``(runfunc, args, kwargs)`` Or return two tuple of maximum length 3: ``(runfunc, args, kwargs), (postproc, postproc_args, postproc_kwargs)')
    if ((self._runfunc is not None) and (not self._do_single_runs)):
        raise RuntimeError('You cannot make a run if you did create an environment with `do_single_runs=False`.')
    if self._resumable:
        racedirs(self._resume_path)
        if os.listdir(self._resume_path):
            raise RuntimeError(('Your resume folder `%s` needs to be empty to allow continuing!' % self._resume_path))
    if self._user_pipeline:
        self._logger.info(('\n************************************************************\nSTARTING PPREPROCESSING for trajectory\n`%s`\n************************************************************\n' % self._traj.v_name))
    self._logger.info('I am preparing the Trajectory for the experiment and initialise the store.')
    self._traj._prepare_experiment()
    self._logger.info('Initialising the storage for the trajectory.')
    self._traj.f_store(only_init=True)

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