Author: bugman Date: Thu Apr 24 16:42:15 2014 New Revision: 22851 URL: http://svn.gna.org/viewcvs/relax?rev=22851&view=rev Log: Expanded the dispersion specific API set_param_values() method for the 'r2eff' and 'i0' parameters. This now sets these parameter values correctly if the value sent into the method is not composed of dictionaries. Modified: trunk/specific_analyses/relax_disp/api.py Modified: trunk/specific_analyses/relax_disp/api.py URL: http://svn.gna.org/viewcvs/relax/trunk/specific_analyses/relax_disp/api.py?rev=22851&r1=22850&r2=22851&view=diff ============================================================================== --- trunk/specific_analyses/relax_disp/api.py (original) +++ trunk/specific_analyses/relax_disp/api.py Thu Apr 24 16:42:15 2014 @@ -909,8 +909,29 @@ if param[i] in PARAMS_R20: # Loop over the current keys. for exp_type, frq in loop_exp_frq(): - # Create the key and set the value. + # The parameter key. key = generate_r20_key(exp_type=exp_type, frq=frq) + + # Initialise the structure if needed. + if not hasattr(spin, obj_name): + setattr(spin, obj_name, {}) + + # Set the value. + obj = getattr(spin, obj_name) + obj[key] = value[i] + + # Handle the R2eff and I0 parameters. + elif param[i] in ['r2eff', 'i0'] and not isinstance(value[i], dict): + # Loop over all the data. + for exp_type, frq, offset, point in loop_exp_frq_offset_point(): + # The parameter key. + key = return_param_key_from_data(exp_type=exp_type, frq=frq, offset=offset, point=point) + + # Initialise the structure if needed. + if not hasattr(spin, obj_name): + setattr(spin, obj_name, {}) + + # Set the value. obj = getattr(spin, obj_name) obj[key] = value[i]