Author: bugman Date: Tue Apr 27 17:58:00 2010 New Revision: 11154 URL: http://svn.gna.org/viewcvs/relax?rev=11154&view=rev Log: The n_state_model.select_model() user function can now change the model. Previously a RelaxError was thrown, but now a warning is given that the model is changing. This allows the 'population' N-state model to be optimised by first optimising the 'fixed' model and then switching to 'population'. Modified: 1.3/specific_fns/n_state_model.py Modified: 1.3/specific_fns/n_state_model.py URL: http://svn.gna.org/viewcvs/relax/1.3/specific_fns/n_state_model.py?rev=11154&r1=11153&r2=11154&view=diff ============================================================================== --- 1.3/specific_fns/n_state_model.py (original) +++ 1.3/specific_fns/n_state_model.py Tue Apr 27 17:58:00 2010 @@ -1201,13 +1201,13 @@ # Test if the current data pipe exists. pipes.test() - # Test if the model is setup. - if hasattr(cdp, 'model'): - raise RelaxModelError('N-state') - # Test if the model name exists. if not model in ['2-domain', 'population', 'fixed']: raise RelaxError("The model name " + repr(model) + " is invalid.") + + # Test if the model is setup. + if hasattr(cdp, 'model'): + warn(RelaxWarning("The N-state model has already been set up. Switching from model '%s' to '%s'." % (cdp.model, model))) # Set the model cdp.model = model