Author: bugman Date: Fri Feb 15 11:43:11 2008 New Revision: 5011 URL: http://svn.gna.org/viewcvs/relax?rev=5011&view=rev Log: Merged revisions 5008-5009 via svnmerge from svn+ssh://bugman@xxxxxxxxxxx/svn/relax/1.3 ........ r5008 | bugman | 2008-02-15 11:36:16 +0100 (Fri, 15 Feb 2008) | 3 lines Added select flags to the molecule and residue container and list data structures. ........ r5009 | bugman | 2008-02-15 11:37:58 +0100 (Fri, 15 Feb 2008) | 3 lines Converted all the select variables of the mol-res-spin structures to booleans. ........ Modified: branches/N_state_model/ (props changed) branches/N_state_model/data/mol_res_spin.py Propchange: branches/N_state_model/ ------------------------------------------------------------------------------ Binary property 'svnmerge-integrated' - no diff available. Modified: branches/N_state_model/data/mol_res_spin.py URL: http://svn.gna.org/viewcvs/relax/branches/N_state_model/data/mol_res_spin.py?rev=5011&r1=5010&r2=5011&view=diff ============================================================================== --- branches/N_state_model/data/mol_res_spin.py (original) +++ branches/N_state_model/data/mol_res_spin.py Fri Feb 15 11:43:11 2008 @@ -38,7 +38,7 @@ class SpinContainer(Prototype): """Class containing all the spin system specific data.""" - def __init__(self, spin_name=None, spin_num=None, select=1): + def __init__(self, spin_name=None, spin_num=None, select=True): """Set up the default objects of the spin system data container.""" # The spin system name and number. @@ -98,13 +98,13 @@ # Residue data. text = text + "%-8s%-8s%-8s%-10s" % ("Index", "Number", "Name", "Selected") + "\n" for i in xrange(len(self)): - text = text + "%-8i%-8s%-8s%-10i" % (i, `self[i].num`, self[i].name, self[i].select) + "\n" + text = text + "%-8i%-8s%-8s%-10s" % (i, `self[i].num`, self[i].name, self[i].select) + "\n" text = text + "\nThese can be accessed by typing 'D.mol[i].res[j].spin[k]', where D is the relax data storage object.\n" return text - def add_item(self, spin_name=None, spin_num=None, select=1): + def add_item(self, spin_name=None, spin_num=None, select=True): """Function for appending an empty container to the list.""" self.append(SpinContainer(spin_name, spin_num, select)) @@ -117,12 +117,13 @@ class ResidueContainer(Prototype): """Class containing all the residue specific data.""" - def __init__(self, res_name=None, res_num=None): + def __init__(self, res_name=None, res_num=None, select=True): """Set up the default objects of the residue data container.""" # The residue name and number. self.name = res_name self.num = res_num + self.select = select # The empty spin system list. self.spin = SpinList() @@ -177,18 +178,18 @@ text = "Residues.\n\n" # Residue data. - text = text + "%-8s%-8s%-8s" % ("Index", "Number", "Name") + "\n" + text = text + "%-8s%-8s%-8s%-10s" % ("Index", "Number", "Name", "Selected") + "\n" for i in xrange(len(self)): - text = text + "%-8i%-8s%-8s" % (i, `self[i].num`, self[i].name) + "\n" + text = text + "%-8i%-8s%-8s%-10s" % (i, `self[i].num`, self[i].name, self[i].select) + "\n" text = text + "\nThese can be accessed by typing 'D.mol[i].res[j]', where D is the relax data storage object.\n" return text - def add_item(self, res_name=None, res_num=None): + def add_item(self, res_name=None, res_num=None, select=True): """Function for appending an empty container to the list.""" - self.append(ResidueContainer(res_name, res_num)) + self.append(ResidueContainer(res_name, res_num, select)) @@ -198,11 +199,12 @@ class MoleculeContainer(Prototype): """Class containing all the molecule specific data.""" - def __init__(self, mol_name=None): + def __init__(self, mol_name=None, select=True): """Set up the default objects of the molecule data container.""" # The name of the molecule, corresponding to that of the structure file if specified. self.name = mol_name + self.select = select # The empty residue list. self.res = ResidueList() @@ -248,14 +250,14 @@ def __repr__(self): text = "Molecules.\n\n" - text = text + "%-8s%-8s" % ("Index", "Name") + "\n" + text = text + "%-8s%-8s%-10s" % ("Index", "Name", "Selected") + "\n" for i in xrange(len(self)): - text = text + "%-8i%-8s" % (i, self[i].name) + "\n" + text = text + "%-8i%-8s%-10s" % (i, self[i].name, self[i].select) + "\n" text = text + "\nThese can be accessed by typing 'D.mol[i]', where D is the relax data storage object.\n" return text - def add_item(self, mol_name=None): + def add_item(self, mol_name=None, select=True): """Function for appending an empty container to the list.""" - self.append(MoleculeContainer(mol_name)) + self.append(MoleculeContainer(mol_name, select))