Author: bugman Date: Fri Apr 19 22:13:13 2013 New Revision: 19499 URL: http://svn.gna.org/viewcvs/relax?rev=19499&view=rev Log: Merged revisions 19496 via svnmerge from svn+ssh://bugman@xxxxxxxxxxx/svn/relax/trunk ........ r19496 | bugman | 2013-04-19 20:08:05 +0200 (Fri, 19 Apr 2013) | 3 lines The Monte Carlo error_analysis() function now handles dictionary type parameters. ........ Modified: branches/relax_disp/ (props changed) branches/relax_disp/pipe_control/monte_carlo.py Propchange: branches/relax_disp/ ------------------------------------------------------------------------------ --- svnmerge-integrated (original) +++ svnmerge-integrated Fri Apr 19 22:13:13 2013 @@ -1,1 +1,1 @@ -/trunk:1-19494 +/trunk:1-19497 Modified: branches/relax_disp/pipe_control/monte_carlo.py URL: http://svn.gna.org/viewcvs/relax/branches/relax_disp/pipe_control/monte_carlo.py?rev=19499&r1=19498&r2=19499&view=diff ============================================================================== --- branches/relax_disp/pipe_control/monte_carlo.py (original) +++ branches/relax_disp/pipe_control/monte_carlo.py Fri Apr 19 22:13:13 2013 @@ -156,8 +156,23 @@ if param_array == None: break - # SD of simulation parameters with values (ie not None). - if param_array[0] != None: + # Handle dictionary type parameters. + if isinstance(param_array[0], dict): + # Initialise the standard deviation structure as a dictionary. + sd = {} + + # Loop over each key. + for key in param_array[0].keys(): + # Create a list of the values for the current key. + data = [] + for i in range(len(param_array)): + data.append(param_array[i][key]) + + # Calculate and store the SD. + sd[key] = stats.std(values=data, skip=select_sim) + + # SD of simulation parameters with values (ie not None). + elif param_array[0] != None: sd = stats.std(values=param_array, skip=select_sim) # Simulation parameters with the value None.