Hi, I can't remember where, it has been a long time since we discussed this, but somewhere in the discussion I though we decided that the code example from: https://mail.gna.org/public/relax-devel/2010-05/msg00000.html should be switched to match your suggestion of: self.data[spin_index][interaction_index] That way the major loop is the spin loop, and then we loop over each spin-specific interaction (which can be variable). So exactly the code example you give. Sorry for the confusion. Regards, Edward On 27 July 2010 19:51, Pavel Kaderavek <pavel.kaderavek@xxxxxxxxx> wrote:
Dear Edward, we are a bit confused by last few posts. In the post: https://mail.gna.org/public/relax-devel/2010-05/msg00000.html it is suggested to consider the interactions as higher level than the spin and build the data matrix as follows: self.data[interaction_index][spin_index] Based on this we created an example: https://mail.gna.org/public/relax-devel/2010-05/msg00010.html However, in the post: https://mail.gna.org/public/relax-devel/2010-05/msg00012.html the example was commented in the following way: "The first index is the spin and the second is the interaction - your example here has this around the other way." As it seems to be a bit contradictory and we would like to clarify this point. We think that the correct order of the indices should be like this: self.data[spin_index][interaction_index] as mentioned in the last reply. Generally, the code suggested in: https://mail.gna.org/public/relax-devel/2010-05/msg00000.html could be used with the following modifications: # Create the data list of lists used to store the interaction and spin specific data. self.data = [] for spin_index in xrange(self.num_spins): # Add an empty list for the spin. self.data.append([]) # Total number of ri (only sum for the first interaction). self.total_num_ri = self.total_num_ri + num_ri[spin_index] # Loop over the interactions. for int_index in xrange(self.num_interactions[spin_index]): # The ratio of gyromagnetic ratios. g_ratio = gh[spin_index][int_index] / gx[spin_index][int_index] # Append the class instance Data to the interaction list for this spin. self.data[spin_index].append(Data() Best regards, Pavel & Petr