def _process_abundance_vector(self, a, z, isomers, yps):
def cmp_to_key(mycmp):<EOL><INDENT>'<STR_LIT>'<EOL>class K(object):<EOL><INDENT>def __init__(self, obj, *args):<EOL><INDENT>self.obj = obj<EOL><DEDENT>def __lt__(self, other):<EOL><INDENT>return mycmp(self.obj, other.obj) < <NUM_LIT:0><EOL><DEDENT>def __gt__(self, other):<EOL><INDENT>return mycmp(self.obj, other.obj) > <NUM_LIT:0><EOL><DEDENT>def __eq__(self, other):<EOL><INDENT>return mycmp(self.obj, other.obj) == <NUM_LIT:0><EOL><DEDENT>def __le__(self, other):<EOL><INDENT>return mycmp(self.obj, other.obj) <= <NUM_LIT:0><EOL><DEDENT>def __ge__(self, other):<EOL><INDENT>return mycmp(self.obj, other.obj) >= <NUM_LIT:0><EOL><DEDENT>def __ne__(self, other):<EOL><INDENT>return mycmp(self.obj, other.obj) != <NUM_LIT:0><EOL><DEDENT><DEDENT>return K<EOL><DEDENT>tmp=[]<EOL>isom=[]<EOL>for i in range(len(a)):<EOL><INDENT>if z[i]!=<NUM_LIT:0> and isomers[i]==<NUM_LIT:1>: <EOL><INDENT>tmp.append([self.stable_names[int(z[i])]+'<STR_LIT:->'+str(int(a[i])),yps[i],z[i],a[i]])<EOL><DEDENT>elif isomers[i]!=<NUM_LIT:1>: <EOL><INDENT>if yps[i]==<NUM_LIT:0>:<EOL><INDENT>isom.append([self.stable_names[int(z[i])]+'<STR_LIT:->'+str(int(a[i]))+'<STR_LIT:->'+str(int(isomers[i]-<NUM_LIT:1>)),<NUM_LIT>])<EOL><DEDENT>else:<EOL><INDENT>isom.append([self.stable_names[int(z[i])]+'<STR_LIT:->'+str(int(a[i]))+'<STR_LIT:->'+str(int(isomers[i]-<NUM_LIT:1>)),yps[i]])<EOL><DEDENT><DEDENT><DEDENT>tmp.sort(key = cmp_to_key(self.compar))<EOL>tmp.sort(key = cmp_to_key(self.comparator))<EOL>abunds=[]<EOL>isotope_to_plot=[]<EOL>z_iso_to_plot=[]<EOL>a_iso_to_plot=[]<EOL>el_iso_to_plot=[]<EOL>for i in range(len(tmp)):<EOL><INDENT>isotope_to_plot.append(tmp[i][<NUM_LIT:0>])<EOL>abunds.append(tmp[i][<NUM_LIT:1>])<EOL>z_iso_to_plot.append(int(tmp[i][<NUM_LIT:2>]))<EOL>a_iso_to_plot.append(int(tmp[i][<NUM_LIT:3>]))<EOL>el_iso_to_plot.append(self.stable_names[int(tmp[i][<NUM_LIT:2>])])<EOL><DEDENT>return a_iso_to_plot,z_iso_to_plot,abunds,isotope_to_plot,el_iso_to_plot,isom<EOL>
This private method takes as input one vector definition and
processes it, including sorting by charge number and
mass number. It returns the processed input variables
plus an element and isotope vector and a list of
isomers.