def set_isotopic_ratio(self, compound='<STR_LIT>', element='<STR_LIT>', list_ratio=[]):
_stack = self.stack<EOL>list_compounds = _stack.keys()<EOL>if compound not in _stack.keys():<EOL><INDENT>list_compounds_joined = '<STR_LIT:U+002CU+0020>'.join(list_compounds)<EOL>raise ValueError("<STR_LIT>".format(compound, list_compounds_joined))<EOL><DEDENT>if element == '<STR_LIT>':<EOL><INDENT>element = compound<EOL><DEDENT>list_element = _stack[compound].keys()<EOL>if element not in list_element:<EOL><INDENT>list_element_joined = '<STR_LIT:U+002CU+0020>'.join(list_element)<EOL>raise ValueError("<STR_LIT>".format(element, list_element_joined))<EOL><DEDENT>old_list_ratio = _stack[compound][element]['<STR_LIT>']['<STR_LIT:list>']<EOL>if not (len(old_list_ratio) == len(list_ratio)):<EOL><INDENT>raise ValueError("<STR_LIT>".format(len(<EOL>list_ratio), len(old_list_ratio)))<EOL><DEDENT>self.stack[compound][element]['<STR_LIT>']['<STR_LIT>'] = list_ratio<EOL>self.__update_molar_mass(compound=compound, element=element)<EOL>self.__update_density(compound=compound, element=element)<EOL>self.__math_on_stack()<EOL>
defines the new set of ratio of the compound/element and trigger the calculation to update the density

        Parameters:
        ===========
        compound: string (default is ''). Name of compound
        element: string (default is ''). Name of element
        list_ratio: list (default is []). list of new stoichiometric_ratio

        Raises:
        =======
        ValueError if compound does not exist
        ValueError if element does not exist
        ValueError if list_ratio does not have the right format