(self, state)
Add a State object to the container.

        Parameters
        ----------
        state: {dict, State}
            State object to be added. Or a dictionary with
            the following keys: ['select_index', 'queried_info', 'performance']
Add a State object to the container.
Add a State object to the container .
def add_state(self, state):
        """Add a State object to the container.

        Parameters
        ----------
        state: {dict, State}
            State object to be added. Or a dictionary with
            the following keys: ['select_index', 'queried_info', 'performance']
        """
        if not isinstance(state, State):
            assert isinstance(state, dict), "state must be dict or State object."
            assert 'select_index' in state and 'queried_info' in state and 'performance' in state, "The dict must contain the following keys: ['select_index', 'queried_info', 'performance']"
        self.__state_list.append(copy.deepcopy(state))
        self.__update_info()

        if self.__verbose and len(self) % self.__print_interval == 0:
            if self._first_print:
                print('\n' + self.__repr__(), end='')
                self._first_print = False
            else:
                print('\r' + self._refresh_dataline(), end='')
                sys.stdout.flush()
def add_state ( self , state ) : if not isinstance ( state , State ) : assert isinstance ( state , dict ) , "state must be dict or State object." assert 'select_index' in state and 'queried_info' in state and 'performance' in state , "The dict must contain the following keys: ['select_index', 'queried_info', 'performance']" self . __state_list . append ( copy . deepcopy ( state ) ) self . __update_info ( ) if self . __verbose and len ( self ) % self . __print_interval == 0 : if self . _first_print : print ( '\n' + self . __repr__ ( ) , end = '' ) self . _first_print = False else : print ( '\r' + self . _refresh_dataline ( ) , end = '' ) sys . stdout . flush ( )