Author: bugman Date: Fri Jan 23 15:33:46 2009 New Revision: 8630 URL: http://svn.gna.org/viewcvs/relax?rev=8630&view=rev Log: Improvements to the internal load_pdb() method. The molecule naming algorithm, when no name is given, is now aware of the names of previously loaded molecules. Modified: branches/multi_structure/generic_fns/structure/internal.py Modified: branches/multi_structure/generic_fns/structure/internal.py URL: http://svn.gna.org/viewcvs/relax/branches/multi_structure/generic_fns/structure/internal.py?rev=8630&r1=8629&r2=8630&view=diff ============================================================================== --- branches/multi_structure/generic_fns/structure/internal.py (original) +++ branches/multi_structure/generic_fns/structure/internal.py Fri Jan 23 15:33:46 2009 @@ -604,8 +604,14 @@ if set_mol_name: new_mol_name.append(set_mol_name[mol_index]) else: + # Number of structures already present for the model. + num_struct = 0 + for model in self.structural_data: + if model_index <= len(set_model_num) and set_model_num[model_index] == model.num: + num_struct = len(model.mol) + # Set the name to the file name plus the structure number. - new_mol_name.append(file_root(file) + '_mol' + `mol_num`) + new_mol_name.append(file_root(file) + '_mol' + `mol_num+num_struct`) # Store the original mol number. orig_mol_num.append(mol_num)