Author: bugman Date: Mon Nov 7 11:07:33 2011 New Revision: 14975 URL: http://svn.gna.org/viewcvs/relax?rev=14975&view=rev Log: Fix for the internal structural object add_atom() method for when no models or molecules are present. Modified: 1.3/generic_fns/structure/internal.py Modified: 1.3/generic_fns/structure/internal.py URL: http://svn.gna.org/viewcvs/relax/1.3/generic_fns/structure/internal.py?rev=14975&r1=14974&r2=14975&view=diff ============================================================================== --- 1.3/generic_fns/structure/internal.py (original) +++ 1.3/generic_fns/structure/internal.py Mon Nov 7 11:07:33 2011 @@ -599,6 +599,10 @@ # Test if the current data pipe exists. pipes.test() + # Add a model if not present. + if len(self.structural_data) == 0: + self.add_model() + # Loop over each model. for model in self.structural_data: # Specific molecule. @@ -607,6 +611,7 @@ # Add the molecule, if it does not exist. if mol == None: self.add_molecule(name=mol_name) + mol = self.get_molecule(mol_name, model=model.num) # Add the atom. mol.atom_add(atom_name=atom_name, res_name=res_name, res_num=res_num, pos=pos, element=element, atom_num=atom_num, chain_id=chain_id, segment_id=segment_id, pdb_record=pdb_record)