Author: bugman Date: Wed Apr 3 12:58:24 2013 New Revision: 19321 URL: http://svn.gna.org/viewcvs/relax?rev=19321&view=rev Log: Merged revisions 19320 via svnmerge from svn+ssh://bugman@xxxxxxxxxxx/svn/relax/trunk ........ r19320 | bugman | 2013-04-03 12:57:40 +0200 (Wed, 03 Apr 2013) | 5 lines Created the specific API common method _data_init_spin(). This will be used as a general method for aliasing to data_init() for initialising spin parameters. ........ Modified: branches/relax_disp/ (props changed) branches/relax_disp/specific_analyses/api_common.py Propchange: branches/relax_disp/ ------------------------------------------------------------------------------ --- svnmerge-integrated (original) +++ svnmerge-integrated Wed Apr 3 12:58:24 2013 @@ -1,1 +1,1 @@ -/trunk:1-19308 +/trunk:1-19320 Modified: branches/relax_disp/specific_analyses/api_common.py URL: http://svn.gna.org/viewcvs/relax/branches/relax_disp/specific_analyses/api_common.py?rev=19321&r1=19320&r2=19321&view=diff ============================================================================== --- branches/relax_disp/specific_analyses/api_common.py (original) +++ branches/relax_disp/specific_analyses/api_common.py Wed Apr 3 12:58:24 2013 @@ -88,6 +88,30 @@ """ + def _data_init_spin(self, data_cont, sim=False): + """Initialise data structures (spin system specific). + + @param data_cont: The spin container. + @type data_cont: SpinContainer instance + @keyword sim: The Monte Carlo simulation flag, which if true will initialise the simulation data structure. + @type sim: bool + """ + + # Loop over the parameters. + for name in self.PARAMS.loop(set='params', scope='spin', error_names=False, sim_names=sim): + # The default value. + param_type = self.PARAMS.get_type(name) + if param_type == 'dict': + value = {} + elif param_type == 'list': + value = [] + else: + value = None + + # Set the value. + setattr(data_cont, name, value) + + def _eliminate_false(self, name, value, model_info, args, sim=None): """Dummy method for model elimination.