Author: bugman Date: Tue Apr 8 15:39:08 2008 New Revision: 5437 URL: http://svn.gna.org/viewcvs/relax?rev=5437&view=rev Log: Modified load_spins() to handle a single molecule with no name. Modified: 1.3/generic_fns/structure/main.py Modified: 1.3/generic_fns/structure/main.py URL: http://svn.gna.org/viewcvs/relax/1.3/generic_fns/structure/main.py?rev=5437&r1=5436&r2=5437&view=diff ============================================================================== --- 1.3/generic_fns/structure/main.py (original) +++ 1.3/generic_fns/structure/main.py Tue Apr 8 15:39:08 2008 @@ -54,8 +54,13 @@ # Loop over all atoms of the spin_id selection. for mol_name, res_num, res_name, atom_num, atom_name, pos in cdp.structure.atom_loop(atom_id=spin_id, pos=True): - # Get the corresponding molecule container. - mol_cont = return_molecule('#' + mol_name) + # Get the molecule container corresponding to the molecule name. + if mol_name: + mol_cont = return_molecule('#' + mol_name) + + # The is only one molecule and it is unnamed. + elif cdp.mol[0].name == None and len(cdp.mol) == 1: + mol_cont = cdp.mol[0] # Add the molecule if it doesn't exist. if mol_name and mol_cont == None: