

def add_postprocessing(self, postproc, *args, **kwargs):
    " Adds a post processing function.\n\n        The environment will call this function via\n        ``postproc(traj, result_list, *args, **kwargs)`` after the completion of the\n        single runs.\n\n        This function can load parts of the trajectory id needed and add additional results.\n\n        Moreover, the function can be used to trigger an expansion of the trajectory.\n        This can be useful if the user has an `optimization` task.\n\n        Either the function calls `f_expand` directly on the trajectory or returns\n        an dictionary. If latter `f_expand` is called by the environment.\n\n        Note that after expansion of the trajectory, the post-processing function is called\n        again (and again for further expansions). Thus, this allows an iterative approach\n        to parameter exploration.\n\n        Note that in case post-processing is called after all runs have been executed,\n        the storage service of the trajectory is no longer multiprocessing safe.\n        If you want to use multiprocessing in your post-processing you can still\n        manually wrap the storage service with the :class:`~pypet.environment.MultiprocessWrapper`.\n\n        In case you use **immediate** postprocessing, the storage service of your trajectory\n        is still multiprocessing safe (except when using the wrap_mode ``'LOCAL'``).\n        Accordingly, you could even use multiprocessing in your immediate post-processing phase\n        if you dare, like use a multiprocessing pool_, for instance.\n\n        You can easily check in your post-processing function if the storage service is\n        multiprocessing safe via the ``multiproc_safe`` attribute, i.e.\n        ``traj.v_storage_service.multiproc_safe``.\n\n        :param postproc:\n\n            The post processing function\n\n        :param args:\n\n            Additional arguments passed to the post-processing function\n\n        :param kwargs:\n\n            Additional keyword arguments passed to the postprocessing function\n\n        :return:\n\n        "
    self._postproc = postproc
    self._postproc_args = args
    self._postproc_kwargs = kwargs

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