Author: bugman
Date: Thu Jan 22 10:44:36 2009
New Revision: 8576
URL: http://svn.gna.org/viewcvs/relax?rev=8576&view=rev
Log:
Expanded the structural data validate() method to check molecule names.
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=8576&r1=8575&r2=8576&view=diff
==============================================================================
--- branches/multi_structure/generic_fns/structure/api_base.py (original)
+++ branches/multi_structure/generic_fns/structure/api_base.py Thu Jan 22
10:44:36 2009
@@ -712,8 +712,17 @@
# Loop over all other models.
for i in range(1, len(self.structural_data)):
- if num_mols != len(self.structural_data[i].mol):
+ # Model alias.
+ model_i = self.structural_data[i]
+
+ # Size check.
+ if num_mols != len(model_i.mol):
raise RelaxError, "The structural object is not valid - the
number of molecules is not the same for all models."
+
+ # Molecule name check.
+ for j in range(len(model_i.mol)):
+ if model_i.mol[j].mol_name !=
self.structural_data[0].mol[j].mol_name:
+ raise RelaxError, "The molecule name '%s' of model %s does
not match the corresponding molecule '%s' of model %s." %
(model_i.mol[j].mol_name, model_i.num, self.structural_data[0].mol[j].mol_name,
self.structural_data[0].num)
_______________________________________________
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