Author: bugman Date: Thu Feb 24 12:19:39 2011 New Revision: 12618 URL: http://svn.gna.org/viewcvs/relax?rev=12618&view=rev Log: Created a special list-like structure for spin specific data. This is in response to the post of Pavel Kaderavek <pavel dot kaderavek att gmail dott com> at https://mail.gna.org/public/relax-devel/2011-02/msg00071.html (Message-id: <AANLkTi=DQ9KGP+e0ONhZ66XhSzKhuQzFoQcQNwXnVsgG@xxxxxxxxxxxxxx>). Modified: branches/cst/maths_fns/mf.py Modified: branches/cst/maths_fns/mf.py URL: http://svn.gna.org/viewcvs/relax/branches/cst/maths_fns/mf.py?rev=12618&r1=12617&r2=12618&view=diff ============================================================================== --- branches/cst/maths_fns/mf.py (original) +++ branches/cst/maths_fns/mf.py Thu Feb 24 12:19:39 2011 @@ -1,6 +1,6 @@ ############################################################################### # # -# Copyright (C) 2003-2008 Edward d'Auvergne # +# Copyright (C) 2003-2011 Edward d'Auvergne # # Copyright (C) 2010 Pavel Kaderavek # # # # This file is part of the program relax. # @@ -25,6 +25,7 @@ # Python module imports. from math import pi from numpy import dot, float64, ones, sum, transpose, zeros +from types import ListType # relax module imports. from relax_errors import RelaxError @@ -254,7 +255,8 @@ # Total number of ri. self.total_num_ri = self.total_num_ri + num_ri[i] - self.data.append([]) + # Append a list-like object for the spin specific data. + self.data.append(Spin_object()) # The ratio of gyromagnetic ratios. g_ratio = gh[i] / gx[i] @@ -3021,6 +3023,11 @@ return 1 + class Data: - def __init__(self): - """Empty container for storing data.""" + """Empty container for storing data.""" + + + +class Spin_object(ListType): + """A special list-like object for the spin specific data structure."""