Author: bugman Date: Wed Jul 9 13:37:45 2008 New Revision: 6872 URL: http://svn.gna.org/viewcvs/relax?rev=6872&view=rev Log: Made the __update_model() method less fatal. Modified: branches/rdc_analysis/specific_fns/n_state_model.py Modified: branches/rdc_analysis/specific_fns/n_state_model.py URL: http://svn.gna.org/viewcvs/relax/branches/rdc_analysis/specific_fns/n_state_model.py?rev=6872&r1=6871&r2=6872&view=diff ============================================================================== --- branches/rdc_analysis/specific_fns/n_state_model.py (original) +++ branches/rdc_analysis/specific_fns/n_state_model.py Wed Jul 9 13:37:45 2008 @@ -51,22 +51,19 @@ # Alias the current data pipe. cdp = ds[ds.current_pipe] - # Determine the number of states, if not already set. - if not hasattr(cdp, 'N'): - # No structures. - if not hasattr(cdp, 'structure'): - raise RelaxError, "The number of states cannot be determined as no structures are loaded." - - # Set the number. - cdp.N = cdp.structure.num_structures() - - # No states? - if not cdp.N > 0: - raise RelaxError, "The number of states " + `cdp.N` + " is invalid." - # Initialise the list of model parameters. if not hasattr(cdp, 'params'): cdp.params = [] + + # Determine the number of states, if not already set. + if not hasattr(cdp, 'N'): + # Set the number. + if hasattr(cdp, 'structure'): + cdp.N = cdp.structure.num_structures() + + # Otherwise return as the rest cannot be updated without N. + else: + return # Add the probability or population weight parameters. for i in xrange(cdp.N-1):