Author: bugman Date: Thu Jan 15 17:09:45 2009 New Revision: 8477 URL: http://svn.gna.org/viewcvs/relax?rev=8477&view=rev Log: Deletion of the API num_structures() method, and creation of num_models() and num_molecules(). 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=8477&r1=8476&r2=8477&view=diff ============================================================================== --- branches/multi_structure/generic_fns/structure/api_base.py (original) +++ branches/multi_structure/generic_fns/structure/api_base.py Thu Jan 15 17:09:45 2009 @@ -266,14 +266,28 @@ raise RelaxImplementError - def num_structures(self): - """Method for returning the number of loaded structures (i.e. number of NMR models, etc.). - - @return: The number of structures which have been loaded. + def num_models(self): + """Method for returning the number of models. + + @return: The number of models in the structural object. @rtype: int """ return len(self.structural_data) + + + def num_molecules(self): + """Method for returning the number of molecules. + + @return: The number of molecules in the structural object. + @rtype: int + """ + + # Validate the structural object. + self.validate() + + # Return the number. + return len(self.structural_data[0].mol) def pack_structs(self, data_matrix, orig_model_num=None, set_model_num=None, orig_mol_num=None, set_mol_name=None, file_name=None, file_path=None):