pypet/trajectory.py
def _rename_full_name(self, full_name, other_trajectory, used_runs=None, new_run_idx=None):
        """Renames a full name based on the wildcards and a particular run"""
        split_name = full_name.split('.')
        for idx, name in enumerate(split_name):
            if name in other_trajectory._reversed_wildcards:
                run_indices, wildcards = other_trajectory._reversed_wildcards[name]
                if new_run_idx is None:
                    # We can safely take the first index of the index list that matches
                    run_idx = None
                    for run_jdx in run_indices:
                        if run_jdx in used_runs:
                            run_idx = used_runs[run_jdx]
                            break
                        elif run_jdx == -1:
                            run_idx = -1
                            break
                    if run_idx is None:
                        raise RuntimeError('You shall not pass!')
                else:
                    run_idx = new_run_idx
                new_name = self.f_wildcard(wildcards[0], run_idx)
                split_name[idx] = new_name
        full_name = '.'.join(split_name)
        return full_name
def _rename_full_name(self, full_name, other_trajectory, used_runs=None, new_run_idx=None):
        split_name = full_name.split('.')
        for idx, name in enumerate(split_name):
            if name in other_trajectory._reversed_wildcards:
                run_indices, wildcards = other_trajectory._reversed_wildcards[name]
                if new_run_idx is None:
                    # We can safely take the first index of the index list that matches
                    run_idx = None
                    for run_jdx in run_indices:
                        if run_jdx in used_runs:
                            run_idx = used_runs[run_jdx]
                            break
                        elif run_jdx == -1:
                            run_idx = -1
                            break
                    if run_idx is None:
                        raise RuntimeError('You shall not pass!')
                else:
                    run_idx = new_run_idx
                new_name = self.f_wildcard(wildcards[0], run_idx)
                split_name[idx] = new_name
        full_name = '.'.join(split_name)
        return full_name
def _rename_full_name ( self , full_name , other_trajectory , used_runs = None , new_run_idx = None ) : split_name = full_name . split ( '.' ) for idx , name in enumerate ( split_name ) : if name in other_trajectory . _reversed_wildcards : run_indices , wildcards = other_trajectory . _reversed_wildcards [ name ] if new_run_idx is None : # We can safely take the first index of the index list that matches run_idx = None for run_jdx in run_indices : if run_jdx in used_runs : run_idx = used_runs [ run_jdx ] break elif run_jdx == - 1 : run_idx = - 1 break if run_idx is None : raise RuntimeError ( 'You shall not pass!' ) else : run_idx = new_run_idx new_name = self . f_wildcard ( wildcards [ 0 ] , run_idx ) split_name [ idx ] = new_name full_name = '.' . join ( split_name ) return full_name
Renames a full name based on the wildcards and a particular run
Renames a full name based on the wildcards and a particular run