Hi Han, I would do this for the residue number which should be unique rather than the residue name which can be used many times.
Cheers, Edward On 24 June 2011 11:06, <[email protected]> wrote: > Author: han87 > Date: Fri Jun 24 11:06:46 2011 > New Revision: 13211 > > URL: http://svn.gna.org/viewcvs/relax?rev=13211&view=rev > Log: > Debugging the user function load_spins() > > Debugging the user function load_spins() in generic_fns/structure/main.py for > a proper residue check as suggest in: > https://mail.gna.org/public/relax-devel/2011-06/msg00231.html. > > Modified: > branches/xyz/generic_fns/structure/main.py > > Modified: branches/xyz/generic_fns/structure/main.py > URL: > http://svn.gna.org/viewcvs/relax/branches/xyz/generic_fns/structure/main.py?rev=13211&r1=13210&r2=13211&view=diff > ============================================================================== > --- branches/xyz/generic_fns/structure/main.py (original) > +++ branches/xyz/generic_fns/structure/main.py Fri Jun 24 11:06:46 2011 > @@ -229,10 +229,13 @@ > mol_cont = cdp.mol[-1] > > # Add the residue number to the ID string (residue name is ignored > because only the number is unique). > - id = id + ':' + repr(res_num) > - > - # Get the corresponding residue container. > - res_cont = return_residue(id) > + res_cont = None > + if res_name: > + # Update the ID string > + id = id + ':' + res_name > + > + # Get the corresponding residue container. > + res_cont = return_residue(id) > > # Add the residue if it doesn't exist. > if res_cont == None: > > > _______________________________________________ > relax (http://nmr-relax.com) > > This is the relax-commits mailing list > [email protected] > > To unsubscribe from this list, get a password > reminder, or change your subscription options, > visit the list information page at > https://mail.gna.org/listinfo/relax-commits > _______________________________________________ relax (http://nmr-relax.com) This is the relax-devel mailing list [email protected] To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-devel

