Author: bugman Date: Fri Jan 23 15:50:14 2009 New Revision: 8631 URL: http://svn.gna.org/viewcvs/relax?rev=8631&view=rev Log: Added consistency checks for the packing of the structural data. The names of molecules must now match in all models. Modified: branches/multi_structure/generic_fns/structure/api_base.py Modified: branches/multi_structure/generic_fns/structure/api_base.py URL: http://svn.gna.org/viewcvs/relax/branches/multi_structure/generic_fns/structure/api_base.py?rev=8631&r1=8630&r2=8631&view=diff ============================================================================== --- branches/multi_structure/generic_fns/structure/api_base.py (original) +++ branches/multi_structure/generic_fns/structure/api_base.py Fri Jan 23 15:50:14 2009 @@ -359,6 +359,11 @@ # Print out. print "Adding molecule '%s' to model %s (from the original molecule number %s of model %s)" % (set_mol_name[j], set_model_num[i], orig_mol_num[j], orig_model_num[i]) + # Consistency check. + index = len(model.mol) + if model.num != self.structural_data[0].num and self.structural_data[0].mol[index].mol_name != set_mol_name[j]: + raise RelaxError, "The new molecule name of '%s' in model %s does not match the corresponding molecule's name of '%s' in model %s." % (set_mol_name[j], set_model_num[i], self.structural_data[0].mol[index].mol_name, self.structural_data[0].num) + # Pack the structures. model.mol.add_item(mol_name=set_mol_name[j], mol_cont=data_matrix[i][j])