Author: bugman Date: Fri Mar 22 12:28:51 2013 New Revision: 18953 URL: http://svn.gna.org/viewcvs/relax?rev=18953&view=rev Log: Next block of the manual merger of the frame_order_testing branch. The commands used were: svn merge -r15130:15131 svn+ssh://bugman@xxxxxxxxxxx/svn/relax/branches/frame_order_testing . svn merge -r15131:15132 svn+ssh://bugman@xxxxxxxxxxx/svn/relax/branches/frame_order_testing . svn merge -r15132:15133 svn+ssh://bugman@xxxxxxxxxxx/svn/relax/branches/frame_order_testing . svn merge -r15133:15134 svn+ssh://bugman@xxxxxxxxxxx/svn/relax/branches/frame_order_testing . svn merge -r15134:15135 svn+ssh://bugman@xxxxxxxxxxx/svn/relax/branches/frame_order_testing . svn merge -r15135:15136 svn+ssh://bugman@xxxxxxxxxxx/svn/relax/branches/frame_order_testing . svn merge -r15136:15137 svn+ssh://bugman@xxxxxxxxxxx/svn/relax/branches/frame_order_testing . svn merge -r15137:15138 svn+ssh://bugman@xxxxxxxxxxx/svn/relax/branches/frame_order_testing . svn merge -r15138:15139 svn+ssh://bugman@xxxxxxxxxxx/svn/relax/branches/frame_order_testing . svn merge -r15139:15140 svn+ssh://bugman@xxxxxxxxxxx/svn/relax/branches/frame_order_testing . The console messages were: [edau@localhost relax-trunk]$ svn merge -r15130:15131 svn+ssh://bugman@xxxxxxxxxxx/svn/relax/branches/frame_order_testing . Conflict discovered in 'test_suite/system_tests/align_tensor.py'. Select: (p) postpone, (df) diff-full, (e) edit, (mc) mine-conflict, (tc) theirs-conflict, (s) show all options: p --- Merging r15131 into '.': C test_suite/system_tests/align_tensor.py Summary of conflicts: Text conflicts: 1 [edau@localhost relax-trunk]$ svn merge -r15131:15132 svn+ssh://bugman@xxxxxxxxxxx/svn/relax/branches/frame_order_testing . --- Merging r15132 into '.': U generic_fns/structure/mass.py [edau@localhost relax-trunk]$ svn merge -r15132:15133 svn+ssh://bugman@xxxxxxxxxxx/svn/relax/branches/frame_order_testing . Conflict discovered in 'test_suite/unit_tests/_generic_fns/_structure/test_scientific.py'. Select: (p) postpone, (df) diff-full, (e) edit, (mc) mine-conflict, (tc) theirs-conflict, (s) show all options: p --- Merging r15133 into '.': C test_suite/unit_tests/_generic_fns/_structure/test_scientific.py Summary of conflicts: Text conflicts: 1 [edau@localhost relax-trunk]$ svn merge -r15133:15134 svn+ssh://bugman@xxxxxxxxxxx/svn/relax/branches/frame_order_testing . Conflict discovered in 'generic_fns/structure/internal.py'. Select: (p) postpone, (df) diff-full, (e) edit, (mc) mine-conflict, (tc) theirs-conflict, (s) show all options: p --- Merging r15134 into '.': C generic_fns/structure/internal.py U generic_fns/structure/scientific.py Conflict discovered in 'generic_fns/structure/api_base.py'. Select: (p) postpone, (df) diff-full, (e) edit, (mc) mine-conflict, (tc) theirs-conflict, (s) show all options: p C generic_fns/structure/api_base.py Summary of conflicts: Text conflicts: 2 [edau@localhost relax-trunk]$ svn merge -r15134:15135 svn+ssh://bugman@xxxxxxxxxxx/svn/relax/branches/frame_order_testing . Conflict discovered in 'generic_fns/structure/main.py'. Select: (p) postpone, (df) diff-full, (e) edit, (mc) mine-conflict, (tc) theirs-conflict, (s) show all options: p --- Merging r15135 into '.': C generic_fns/structure/main.py Summary of conflicts: Text conflicts: 1 [edau@localhost relax-trunk]$ svn merge -r15135:15136 svn+ssh://bugman@xxxxxxxxxxx/svn/relax/branches/frame_order_testing . --- Merging r15136 into '.': G generic_fns/structure/main.py [edau@localhost relax-trunk]$ svn merge -r15136:15137 svn+ssh://bugman@xxxxxxxxxxx/svn/relax/branches/frame_order_testing . Conflict discovered in 'specific_fns/n_state_model.py'. Select: (p) postpone, (df) diff-full, (e) edit, (mc) mine-conflict, (tc) theirs-conflict, (s) show all options: p --- Merging r15137 into '.': C specific_fns/n_state_model.py Summary of conflicts: Text conflicts: 1 [edau@localhost relax-trunk]$ svn merge -r15137:15138 svn+ssh://bugman@xxxxxxxxxxx/svn/relax/branches/frame_order_testing . Conflict discovered in 'specific_fns/n_state_model.py'. Select: (p) postpone, (df) diff-full, (e) edit, (mc) mine-conflict, (tc) theirs-conflict, (s) show all options: p --- Merging r15138 into '.': C specific_fns/n_state_model.py Summary of conflicts: Text conflicts: 1 [edau@localhost relax-trunk]$ svn merge -r15138:15139 svn+ssh://bugman@xxxxxxxxxxx/svn/relax/branches/frame_order_testing . Conflict discovered in 'specific_fns/n_state_model.py'. Select: (p) postpone, (df) diff-full, (e) edit, (mc) mine-conflict, (tc) theirs-conflict, (s) show all options: p --- Merging r15139 into '.': C specific_fns/n_state_model.py Summary of conflicts: Text conflicts: 1 [edau@localhost relax-trunk]$ svn merge -r15139:15140 svn+ssh://bugman@xxxxxxxxxxx/svn/relax/branches/frame_order_testing . --- Merging r15140 into '.': C prompt/align_tensor.py Summary of conflicts: Tree conflicts: 1 [edau@localhost relax-trunk]$ Modified: trunk/generic_fns/structure/api_base.py trunk/generic_fns/structure/internal.py trunk/generic_fns/structure/main.py trunk/generic_fns/structure/mass.py trunk/generic_fns/structure/scientific.py trunk/specific_fns/n_state_model.py trunk/test_suite/system_tests/align_tensor.py trunk/test_suite/unit_tests/_generic_fns/_structure/test_scientific.py Modified: trunk/generic_fns/structure/api_base.py URL: http://svn.gna.org/viewcvs/relax/trunk/generic_fns/structure/api_base.py?rev=18953&r1=18952&r2=18953&view=diff ============================================================================== --- trunk/generic_fns/structure/api_base.py (original) +++ trunk/generic_fns/structure/api_base.py Fri Mar 22 12:28:51 2013 @@ -1170,6 +1170,15 @@ # Append an empty ModelContainer. self.append(ModelContainer(model_num)) + # Store the model indices. + if not hasattr(self, 'model_indices'): + self.model_indices = {} + self.model_indices[model_num] = len(self) - 1 + + # The sorted model numbers. + self.model_list = self.model_indices.keys() + self.model_list.sort() + def is_empty(self): """Method for testing if this ModelList object is empty. Modified: trunk/generic_fns/structure/internal.py URL: http://svn.gna.org/viewcvs/relax/trunk/generic_fns/structure/internal.py?rev=18953&r1=18952&r2=18953&view=diff ============================================================================== --- trunk/generic_fns/structure/internal.py (original) +++ trunk/generic_fns/structure/internal.py Fri Mar 22 12:28:51 2013 @@ -1223,7 +1223,8 @@ continue # Alias. - mol2 = self.structural_data[j].mol[mol_index] + model_index = self.structural_data.model_indices[self.structural_data.model_list[j]] + mol2 = self.structural_data[model_index].mol[mol_index] # Some sanity checks. if mol2.atom_num[i] != atom_num: @@ -1247,7 +1248,8 @@ continue # Alias. - mol2 = self.structural_data[j].mol[mol_index] + model_index = self.structural_data.model_indices[self.structural_data.model_list[j]] + mol2 = self.structural_data[model_index].mol[mol_index] # Append the position. pos.append([mol2.x[i], mol2.y[i], mol2.z[i]]) @@ -1315,7 +1317,10 @@ model = self.structural_data[0] # Loop over the molecules. - for mol in model.mol: + for mol_index in range(len(model.mol)): + # Alias. + mol = model.mol[mol_index] + # Skip non-matching molecules. if mol_name and mol_name != mol.mol_name: continue @@ -1342,6 +1347,10 @@ # A single model. if model_num != None and self.structural_data[j].num != model_num: continue + + # Alias the molecule. + model_index = self.structural_data.model_indices[self.structural_data.model_list[j]] + mol = self.structural_data[model_index].mol[mol_index] # Get the atom bonded to this model/molecule/residue/atom. bonded_num, bonded_name, element, pos, attached_name, warnings = self._bonded_atom(attached_atom, index, mol) Modified: trunk/generic_fns/structure/main.py URL: http://svn.gna.org/viewcvs/relax/trunk/generic_fns/structure/main.py?rev=18953&r1=18952&r2=18953&view=diff ============================================================================== --- trunk/generic_fns/structure/main.py (original) +++ trunk/generic_fns/structure/main.py Fri Mar 22 12:28:51 2013 @@ -198,14 +198,14 @@ # Assemble the atomic coordinates. coord_from = [] for pos in cdp.structure.atom_loop(atom_id=atom_id, model_num=model_from[i], pos_flag=True): - coord_from.append(pos) + coord_from.append(pos[0]) # Loop over the ending models. for j in range(len(model_to)): # Assemble the atomic coordinates. coord_to = [] for pos in cdp.structure.atom_loop(atom_id=atom_id, model_num=model_to[j], pos_flag=True): - coord_to.append(pos) + coord_to.append(pos[0]) # Send to the base container for the calculations. cdp.structure.displacements._calculate(model_from=model_from[i], model_to=model_to[j], coord_from=array(coord_from), coord_to=array(coord_to), centroid=centroid) @@ -248,7 +248,7 @@ for model in models: coord.append([]) for pos in cdp.structure.atom_loop(atom_id=atom_id, model_num=model, pos_flag=True): - coord[-1].append(pos) + coord[-1].append(pos[0]) coord[-1] = array(coord[-1]) coord = array(coord) @@ -316,12 +316,7 @@ continue # Add the position vector to the spin container. - if ave_pos: - spin_cont.pos = pos - else: - if not hasattr(spin_cont, 'pos'): - spin_cont.pos = [] - spin_cont.pos.append(pos) + spin_cont.pos = pos # Store the data for a printout at the end. data.append([id, repr(pos)]) @@ -344,7 +339,7 @@ raise RelaxNoSpinError(atom) # Test the position. - if not hasattr(subspin, 'pos') or not subspin.pos: + if not hasattr(subspin, 'pos') or subspin.pos == None or not len(subspin.pos): raise RelaxError("Positional information is not available for the atom '%s'." % atom) # Alias the position. @@ -707,7 +702,7 @@ for model in models: coord.append([]) for pos in cdp.structure.atom_loop(atom_id=atom_id, model_num=model, pos_flag=True): - coord[-1].append(pos) + coord[-1].append(pos[0]) coord[-1] = array(coord[-1]) # The different algorithms. Modified: trunk/generic_fns/structure/mass.py URL: http://svn.gna.org/viewcvs/relax/trunk/generic_fns/structure/mass.py?rev=18953&r1=18952&r2=18953&view=diff ============================================================================== --- trunk/generic_fns/structure/mass.py (original) +++ trunk/generic_fns/structure/mass.py Fri Mar 22 12:28:51 2013 @@ -58,7 +58,7 @@ M = 0.0 # Loop over all atoms. - for mol_name, res_num, res_name, atom_num, atom_name, element, pos in cdp.structure.atom_loop(atom_id=atom_id, model_num=model, mol_name_flag=True, res_num_flag=True, res_name_flag=True, atom_num_flag=True, atom_name_flag=True, element_flag=True, pos_flag=True): + for mol_name, res_num, res_name, atom_num, atom_name, element, pos in cdp.structure.atom_loop(atom_id=atom_id, model_num=model, mol_name_flag=True, res_num_flag=True, res_name_flag=True, atom_num_flag=True, atom_name_flag=True, element_flag=True, pos_flag=True, ave=True): # Initialise the spin id string. id = '' Modified: trunk/generic_fns/structure/scientific.py URL: http://svn.gna.org/viewcvs/relax/trunk/generic_fns/structure/scientific.py?rev=18953&r1=18952&r2=18953&view=diff ============================================================================== --- trunk/generic_fns/structure/scientific.py (original) +++ trunk/generic_fns/structure/scientific.py Fri Mar 22 12:28:51 2013 @@ -266,7 +266,8 @@ continue # Alias. - mol2 = self.structural_data[j].mol[mol_index] + model_index = self.structural_data.model_indices[self.structural_data.model_list[j]] + mol2 = self.structural_data[model_index].mol[mol_index] # The residue. if mol2.mol_type != 'other': Modified: trunk/specific_fns/n_state_model.py URL: http://svn.gna.org/viewcvs/relax/trunk/specific_fns/n_state_model.py?rev=18953&r1=18952&r2=18953&view=diff ============================================================================== --- trunk/specific_fns/n_state_model.py (original) +++ trunk/specific_fns/n_state_model.py Fri Mar 22 12:28:51 2013 @@ -855,7 +855,7 @@ interatom.rdc_bc = {} # Append the back calculated PCS. - interatom.rdc_bc[align_id] = model.Dij_theta[align_index, rdc_index] + interatom.rdc_bc[align_id] = model.rdc_theta[align_index, rdc_index] # Increment the data index if the interatom container has data. rdc_index = rdc_index + 1 @@ -1775,17 +1775,17 @@ for id in cdp.align_ids: # No tensors initialised. if not hasattr(cdp, 'align_tensors'): - align_tensor.init(tensor=id, params=[0.0, 0.0, 0.0, 0.0, 0.0]) + align_tensor.init(tensor=id, align_id=id, params=[0.0, 0.0, 0.0, 0.0, 0.0]) # Find if the tensor corresponding to the id exists. exists = False for tensor in cdp.align_tensors: - if id == tensor.name: + if id == tensor.align_id: exists = True # Initialise the tensor. if not exists: - align_tensor.init(tensor=id, params=[0.0, 0.0, 0.0, 0.0, 0.0]) + align_tensor.init(tensor=id, align_id=id, params=[0.0, 0.0, 0.0, 0.0, 0.0]) def base_data_loop(self): Modified: trunk/test_suite/system_tests/align_tensor.py URL: http://svn.gna.org/viewcvs/relax/trunk/test_suite/system_tests/align_tensor.py?rev=18953&r1=18952&r2=18953&view=diff ============================================================================== --- trunk/test_suite/system_tests/align_tensor.py (original) +++ trunk/test_suite/system_tests/align_tensor.py Fri Mar 22 12:28:51 2013 @@ -61,6 +61,10 @@ (0.00014574884684542708, -8.3162940224598374e-05, 7.4927100277784987e-05, 0.00010508245294401461, 3.1156238348722986e-05), (-0.00011267453337899962, 6.412308037476237e-05, -5.7897942333203444e-05, -8.1865863377039068e-05, -2.5273427585025123e-05) ] + + # Define the domains. + self.interpreter.domain(id='full') + self.interpreter.domain(id='red') # Set up the tensors. for i in range(5): Modified: trunk/test_suite/unit_tests/_generic_fns/_structure/test_scientific.py URL: http://svn.gna.org/viewcvs/relax/trunk/test_suite/unit_tests/_generic_fns/_structure/test_scientific.py?rev=18953&r1=18952&r2=18953&view=diff ============================================================================== --- trunk/test_suite/unit_tests/_generic_fns/_structure/test_scientific.py (original) +++ trunk/test_suite/unit_tests/_generic_fns/_structure/test_scientific.py Fri Mar 22 12:28:51 2013 @@ -241,9 +241,10 @@ self.assertEqual(spin_num, 140) self.assertEqual(spin_name, 'OE1') self.assertEqual(element, 'O') - self.assertEqual(pos[0], float('10.055')) - self.assertEqual(pos[1], float('-2.74')) - self.assertEqual(pos[2], float('-13.193')) + self.assertEqual(len(pos), 1) + self.assertEqual(pos[0, 0], float('10.055')) + self.assertEqual(pos[0, 1], float('-2.74')) + self.assertEqual(pos[0, 2], float('-13.193')) # Increment the atom count. atom_count = atom_count + 1