pypet/trajectory.py
def f_migrate(self, new_name=None, in_store=False,
                  new_storage_service=None, **kwargs):
        """Can be called to rename and relocate the trajectory.

        :param new_name: New name of the trajectory, None if you do not want to change the name.

        :param in_store:

            Set this to True if the trajectory has been stored with the new name at the new
            file before  and you just want to "switch back" to the location.
            If you migrate to a store used before and you do not set `in_store=True`,
            the storage service will throw a RuntimeError in case you store the Trajectory
            because it will assume that you try to store a new trajectory that accidentally has
            the very same name as another trajectory. If set to `True` and trajectory is not found
            in the file, the trajectory is simply stored to the file.

        :param new_storage_service:

            New service where you want to migrate to. Leave none if you want to keep the olde one.

        :param kwargs:

            Additional keyword arguments passed to the service.
            For instance, to change the file of the trajectory use ``filename='my_new_file.hdf5``.

        """
        if new_name is not None:
            self._name = new_name

        unused_kwargs = set(kwargs.keys())
        if new_storage_service is not None or len(kwargs) > 0:
            self._storage_service, unused_kwargs = storage_factory(
                                                    storage_service=new_storage_service,
                                                    trajectory=self, **kwargs)
        if len(unused_kwargs) > 0:
            raise ValueError('The following keyword arguments were not used: `%s`' %
                             str(unused_kwargs))

        self._stored = in_store
def f_migrate(self, new_name=None, in_store=False,
                  new_storage_service=None, **kwargs):
        if new_name is not None:
            self._name = new_name

        unused_kwargs = set(kwargs.keys())
        if new_storage_service is not None or len(kwargs) > 0:
            self._storage_service, unused_kwargs = storage_factory(
                                                    storage_service=new_storage_service,
                                                    trajectory=self, **kwargs)
        if len(unused_kwargs) > 0:
            raise ValueError('The following keyword arguments were not used: `%s`' %
                             str(unused_kwargs))

        self._stored = in_store
def f_migrate ( self , new_name = None , in_store = False , new_storage_service = None , * * kwargs ) : if new_name is not None : self . _name = new_name unused_kwargs = set ( kwargs . keys ( ) ) if new_storage_service is not None or len ( kwargs ) > 0 : self . _storage_service , unused_kwargs = storage_factory ( storage_service = new_storage_service , trajectory = self , * * kwargs ) if len ( unused_kwargs ) > 0 : raise ValueError ( 'The following keyword arguments were not used: `%s`' % str ( unused_kwargs ) ) self . _stored = in_store
Can be called to rename and relocate the trajectory.

        :param new_name: New name of the trajectory, None if you do not want to change the name.

        :param in_store:

            Set this to True if the trajectory has been stored with the new name at the new
            file before  and you just want to "switch back" to the location.
            If you migrate to a store used before and you do not set `in_store=True`,
            the storage service will throw a RuntimeError in case you store the Trajectory
            because it will assume that you try to store a new trajectory that accidentally has
            the very same name as another trajectory. If set to `True` and trajectory is not found
            in the file, the trajectory is simply stored to the file.

        :param new_storage_service:

            New service where you want to migrate to. Leave none if you want to keep the olde one.

        :param kwargs:

            Additional keyword arguments passed to the service.
            For instance, to change the file of the trajectory use ``filename='my_new_file.hdf5``.
Can be called to rename and relocate the trajectory .