Author: bugman Date: Tue Jan 15 10:31:38 2008 New Revision: 4706 URL: http://svn.gna.org/viewcvs/relax?rev=4706&view=rev Log: Wrote the n_state_model.model() user function for setting up the N-state model. Modified: branches/N_state_model/prompt/n_state_model.py Modified: branches/N_state_model/prompt/n_state_model.py URL: http://svn.gna.org/viewcvs/relax/branches/N_state_model/prompt/n_state_model.py?rev=4706&r1=4705&r2=4706&view=diff ============================================================================== --- branches/N_state_model/prompt/n_state_model.py (original) +++ branches/N_state_model/prompt/n_state_model.py Tue Jan 15 10:31:38 2008 @@ -40,6 +40,44 @@ # Place relax in the class namespace. self.__relax__ = relax + + + def model(self, N=None): + """Set up the N-state model by specifying the number of states N. + + Keyword Arguments + ~~~~~~~~~~~~~~~~~ + + N: The number of states. + + + Description + ~~~~~~~~~~~ + + Prior to optimisation, the N-state model must be set up. This simply involves the setting + of the number of states N. + + + Examples + ~~~~~~~~ + + To set up a 5-state model, type: + + relax> n_state_model.model(N=5) + """ + + # Function intro text. + if self.__relax__.interpreter.intro: + text = sys.ps3 + "n_state_model.model(" + text = text + "N=" + `N` + ")" + print text + + # Number of states argument. + if type(N) != int: + raise RelaxIntError, ('the number of states N', N) + + # Execute the functional code. + n_state_model.model_setyp(N=N) def set_domain(self, tensor=None, domain=None):