pypet/naturalnaming.py
def _translate_shortcut(self, name):
        """Maps a given shortcut to corresponding name

        * 'run_X' or 'r_X' to 'run_XXXXXXXXX'

        * 'crun' to the current run name in case of a
          single run instance if trajectory is used via `v_crun`

        * 'par' 'parameters'

        * 'dpar' to 'derived_parameters'

        * 'res' to 'results'

        * 'conf' to 'config'

        :return: True or False and the mapped name.

        """

        if isinstance(name, int):
            return True, self._root_instance.f_wildcard('$', name)

        if name.startswith('run_') or name.startswith('r_'):
            split_name = name.split('_')
            if len(split_name) == 2:
                index = split_name[1]
                if index.isdigit():
                    return True, self._root_instance.f_wildcard('$', int(index))
                elif index == 'A':
                    return True, self._root_instance.f_wildcard('$', -1)

        if name.startswith('runtoset_') or name.startswith('rts_'):
            split_name = name.split('_')
            if len(split_name) == 2:
                index = split_name[1]
                if index.isdigit():
                    return True, self._root_instance.f_wildcard('$set', int(index))
                elif index == 'A':
                    return True, self._root_instance.f_wildcard('$set', -1)

        if name in SHORTCUT_SET:
            if name == 'par':
                return True, 'parameters'
            elif name == 'dpar':
                return True, 'derived_parameters'
            elif name == 'res':
                return True, 'results'
            elif name == 'conf':
                return True, 'config'
            else:
                raise RuntimeError('You shall not pass!')

        return False, name
def _translate_shortcut(self, name):
        """Maps a given shortcut to corresponding name

        * 'run_X' or 'r_X' to 'run_XXXXXXXXX'

        * 'crun' to the current run name in case of a
          single run instance if trajectory is used via `v_crun`

        * 'par' 'parameters'

        * 'dpar' to 'derived_parameters'

        * 'res' to 'results'

        * 'conf' to 'config'

        :return: True or False and the mapped name.

        """

        if isinstance(name, int):
            return True, self._root_instance.f_wildcard('$', name)

        if name.startswith('run_') or name.startswith('r_'):
            split_name = name.split('_')
            if len(split_name) == 2:
                index = split_name[1]
                if index.isdigit():
                    return True, self._root_instance.f_wildcard('$', int(index))
                elif index == 'A':
                    return True, self._root_instance.f_wildcard('$', -1)

        if name.startswith('runtoset_') or name.startswith('rts_'):
            split_name = name.split('_')
            if len(split_name) == 2:
                index = split_name[1]
                if index.isdigit():
                    return True, self._root_instance.f_wildcard('$set', int(index))
                elif index == 'A':
                    return True, self._root_instance.f_wildcard('$set', -1)

        if name in SHORTCUT_SET:
            if name == 'par':
                return True, 'parameters'
            elif name == 'dpar':
                return True, 'derived_parameters'
            elif name == 'res':
                return True, 'results'
            elif name == 'conf':
                return True, 'config'
            else:
                raise RuntimeError('You shall not pass!')

        return False, name
Maps a given shortcut to corresponding name

        * 'run_X' or 'r_X' to 'run_XXXXXXXXX'

        * 'crun' to the current run name in case of a
          single run instance if trajectory is used via `v_crun`

        * 'par' 'parameters'

        * 'dpar' to 'derived_parameters'

        * 'res' to 'results'

        * 'conf' to 'config'

        :return: True or False and the mapped name.