def register_element(self, dev_name, idx=None):
        """
        Register a device element to the group list

        Parameters
        ----------
        dev_name : str
            model name
        idx : str
            element idx

        Returns
        -------
        str
            assigned idx
        """
        if dev_name not in self.devices:
            logger.error(
                'Device {} missing. call add_device before adding elements'.
                format(dev_name))
            return
        group_name = self.system.__dict__[dev_name]._group
        if idx is None:  # "if not idx" will fail for idx==0.0
            idx = dev_name + '_' + str(len(self.group[group_name].keys()))
        self.group[group_name][idx] = dev_name
        return idx
def register_element ( self , dev_name , idx = None ) : if dev_name not in self . devices : logger . error ( 'Device {} missing. call add_device before adding elements' . format ( dev_name ) ) return group_name = self . system . __dict__ [ dev_name ] . _group if idx is None : idx = dev_name + '_' + str ( len ( self . group [ group_name ] . keys ( ) ) ) self . group [ group_name ] [ idx ] = dev_name return idx
Register a device element to the group list

        Parameters
        ----------
        dev_name : str
            model name
        idx : str
            element idx

        Returns
        -------
        str
            assigned idx