mailr22261 - in /branches/double_rotor: ./ data_store/ specific_analyses/


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on February 24, 2014 - 10:00:
Author: bugman
Date: Mon Feb 24 10:00:57 2014
New Revision: 22261

URL: http://svn.gna.org/viewcvs/relax?rev=22261&view=rev
Log:
Merged revisions 22260 via svnmerge from 
svn+ssh://bugman@xxxxxxxxxxx/svn/relax/trunk

........
  r22260 | bugman | 2014-02-24 09:56:30 +0100 (Mon, 24 Feb 2014) | 12 lines
  
  Fix for bug #21716 (https://gna.org/bugs/?21716).
  
  This is the failure to save the relax state just after deleting the current 
data pipe, even if other
  data pipes exist.
  
  The problem was that the specific analysis functions data_names() and 
return_data_desc() were being
  retrieved using the current data pipe rather than the actual data pipe that 
the data structures
  belong to.  So if the current data pipe is None, then these fail.  Now the 
data pipe type is being
  passed through all of the to_xml() methods so that the correct data_names() 
and return_data_desc()
  methods are retrieved.
........

Modified:
    branches/double_rotor/   (props changed)
    branches/double_rotor/data_store/__init__.py
    branches/double_rotor/data_store/interatomic.py
    branches/double_rotor/data_store/mol_res_spin.py
    branches/double_rotor/data_store/pipe_container.py
    branches/double_rotor/specific_analyses/hybrid.py

Propchange: branches/double_rotor/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Mon Feb 24 10:00:57 2014
@@ -1,1 +1,1 @@
-/trunk:1-22258
+/trunk:1-22260

Modified: branches/double_rotor/data_store/__init__.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/double_rotor/data_store/__init__.py?rev=22261&r1=22260&r2=22261&view=diff
==============================================================================
--- branches/double_rotor/data_store/__init__.py (original)
+++ branches/double_rotor/data_store/__init__.py Mon Feb 24 10:00:57 2014
@@ -1,6 +1,6 @@
 
###############################################################################
 #                                                                            
 #
-# Copyright (C) 2003-2013 Edward d'Auvergne                                  
 #
+# Copyright (C) 2003-2014 Edward d'Auvergne                                  
 #
 #                                                                            
 #
 # This file is part of the program relax (http://www.nmr-relax.com).         
 #
 #                                                                            
 #
@@ -615,7 +615,7 @@
             pipe_element.setAttribute('type', self[pipe].pipe_type)
 
             # Fill the data pipe XML element.
-            self[pipe].to_xml(xmldoc, pipe_element)
+            self[pipe].to_xml(xmldoc, pipe_element, 
pipe_type=self[pipe].pipe_type)
 
         # Write out the XML file.
         file.write(xmldoc.toprettyxml(indent='    '))

Modified: branches/double_rotor/data_store/interatomic.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/double_rotor/data_store/interatomic.py?rev=22261&r1=22260&r2=22261&view=diff
==============================================================================
--- branches/double_rotor/data_store/interatomic.py (original)
+++ branches/double_rotor/data_store/interatomic.py Mon Feb 24 10:00:57 2014
@@ -1,6 +1,6 @@
 
###############################################################################
 #                                                                            
 #
-# Copyright (C) 2007-2013 Edward d'Auvergne                                  
 #
+# Copyright (C) 2007-2014 Edward d'Auvergne                                  
 #
 #                                                                            
 #
 # This file is part of the program relax (http://www.nmr-relax.com).         
 #
 #                                                                            
 #
@@ -191,18 +191,20 @@
             xml_to_object(interatom_node, self[-1], 
file_version=file_version)
 
 
-    def to_xml(self, doc, element):
+    def to_xml(self, doc, element, pipe_type=None):
         """Create XML elements for each spin.
 
-        @param doc:     The XML document object.
-        @type doc:      xml.dom.minidom.Document instance
-        @param element: The element to add the spin XML elements to.
-        @type element:  XML element object
+        @param doc:         The XML document object.
+        @type doc:          xml.dom.minidom.Document instance
+        @param element:     The element to add the spin XML elements to.
+        @type element:      XML element object
+        @keyword pipe_type: The type of the pipe being converted to XML.
+        @type pipe_type:    str
         """
 
         # Get the specific functions.
-        data_names = specific_analyses.setup.get_specific_fn('data_names', 
pipe_control.pipes.get_type(), raise_error=False)
-        return_data_desc = 
specific_analyses.setup.get_specific_fn('return_data_desc', 
pipe_control.pipes.get_type(), raise_error=False)
+        data_names = specific_analyses.setup.get_specific_fn('data_names', 
pipe_type, raise_error=False)
+        return_data_desc = 
specific_analyses.setup.get_specific_fn('return_data_desc', pipe_type, 
raise_error=False)
 
         # Loop over the containers.
         for i in range(len(self)):

Modified: branches/double_rotor/data_store/mol_res_spin.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/double_rotor/data_store/mol_res_spin.py?rev=22261&r1=22260&r2=22261&view=diff
==============================================================================
--- branches/double_rotor/data_store/mol_res_spin.py (original)
+++ branches/double_rotor/data_store/mol_res_spin.py Mon Feb 24 10:00:57 2014
@@ -1,6 +1,6 @@
 
###############################################################################
 #                                                                            
 #
-# Copyright (C) 2007-2013 Edward d'Auvergne                                  
 #
+# Copyright (C) 2007-2014 Edward d'Auvergne                                  
 #
 #                                                                            
 #
 # This file is part of the program relax (http://www.nmr-relax.com).         
 #
 #                                                                            
 #
@@ -305,18 +305,21 @@
             self[-1]._back_compat_hook(file_version)
 
 
-    def to_xml(self, doc, element):
+    def to_xml(self, doc, element, pipe_type=None):
         """Create XML elements for each spin.
 
-        @param doc:     The XML document object.
-        @type doc:      xml.dom.minidom.Document instance
-        @param element: The element to add the spin XML elements to.
-        @type element:  XML element object
+        @param doc:         The XML document object.
+        @type doc:          xml.dom.minidom.Document instance
+        @param element:     The element to add the spin XML elements to.
+        @type element:      XML element object
+        @keyword pipe_type: The type of the pipe being converted to XML.
+        @type pipe_type:    str
         """
 
         # Get the specific functions.
-        data_names = specific_analyses.setup.get_specific_fn('data_names', 
pipe_control.pipes.get_type(), raise_error=False)
-        return_data_desc = 
specific_analyses.setup.get_specific_fn('return_data_desc', 
pipe_control.pipes.get_type(), raise_error=False)
+        print `pipe_type`
+        data_names = specific_analyses.setup.get_specific_fn('data_names', 
pipe_type, raise_error=False)
+        return_data_desc = 
specific_analyses.setup.get_specific_fn('return_data_desc', pipe_type, 
raise_error=False)
 
         # Loop over the spins.
         for i in range(len(self)):
@@ -565,13 +568,15 @@
             self[-1].spin.from_xml(spin_nodes, file_version=file_version)
 
 
-    def to_xml(self, doc, element):
+    def to_xml(self, doc, element, pipe_type=None):
         """Create XML elements for each residue.
 
-        @param doc:     The XML document object.
-        @type doc:      xml.dom.minidom.Document instance
-        @param element: The element to add the residue XML elements to.
-        @type element:  XML element object
+        @param doc:         The XML document object.
+        @type doc:          xml.dom.minidom.Document instance
+        @param element:     The element to add the residue XML elements to.
+        @type element:      XML element object
+        @keyword pipe_type: The type of the pipe being converted to XML.
+        @type pipe_type:    str
         """
 
         # Loop over the residues.
@@ -589,7 +594,7 @@
             fill_object_contents(doc, res_element, object=self[i], 
blacklist=['name', 'num', 'spin'] + list(self[i].__class__.__dict__.keys()))
 
             # Add the residue data.
-            self[i].spin.to_xml(doc, res_element)
+            self[i].spin.to_xml(doc, res_element, pipe_type=pipe_type)
 
 
 
@@ -779,13 +784,15 @@
             self[-1].res.from_xml(res_nodes, file_version=file_version)
 
 
-    def to_xml(self, doc, element):
+    def to_xml(self, doc, element, pipe_type=None):
         """Create XML elements for each molecule.
 
-        @param doc:     The XML document object.
-        @type doc:      xml.dom.minidom.Document instance
-        @param element: The element to add the molecule XML elements to.
-        @type element:  XML element object
+        @param doc:         The XML document object.
+        @type doc:          Xml.dom.minidom.Document instance
+        @param element:     The element to add the molecule XML elements to.
+        @type element:      XML element object
+        @keyword pipe_type: The type of the pipe being converted to XML.
+        @type pipe_type:    str
         """
 
         # Loop over the molecules.
@@ -803,4 +810,4 @@
             fill_object_contents(doc, mol_element, object=self[i], 
blacklist=['name', 'res', 'type'] + list(self[i].__class__.__dict__.keys()))
 
             # Add the residue data.
-            self[i].res.to_xml(doc, mol_element)
+            self[i].res.to_xml(doc, mol_element, pipe_type=pipe_type)

Modified: branches/double_rotor/data_store/pipe_container.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/double_rotor/data_store/pipe_container.py?rev=22261&r1=22260&r2=22261&view=diff
==============================================================================
--- branches/double_rotor/data_store/pipe_container.py (original)
+++ branches/double_rotor/data_store/pipe_container.py Mon Feb 24 10:00:57 
2014
@@ -1,6 +1,6 @@
 
###############################################################################
 #                                                                            
 #
-# Copyright (C) 2007-2013 Edward d'Auvergne                                  
 #
+# Copyright (C) 2007-2014 Edward d'Auvergne                                  
 #
 #                                                                            
 #
 # This file is part of the program relax (http://www.nmr-relax.com).         
 #
 #                                                                            
 #
@@ -288,13 +288,15 @@
         return True
 
 
-    def to_xml(self, doc, element):
+    def to_xml(self, doc, element, pipe_type=None):
         """Create a XML element for the current data pipe.
 
-        @param doc:     The XML document object.
-        @type doc:      xml.dom.minidom.Document instance
-        @param element: The XML element to add the pipe XML element to.
-        @type element:  XML element object
+        @param doc:         The XML document object.
+        @type doc:          xml.dom.minidom.Document instance
+        @param element:     The XML element to add the pipe XML element to.
+        @type element:      XML element object
+        @keyword pipe_type: The type of the pipe being converted to XML.
+        @type pipe_type:    str
         """
 
         # Add all simple python objects within the PipeContainer to the 
global element.
@@ -319,10 +321,10 @@
             self.align_tensors.to_xml(doc, element)
 
         # Add the molecule-residue-spin data.
-        self.mol.to_xml(doc, element)
+        self.mol.to_xml(doc, element, pipe_type=pipe_type)
 
         # Add the interatomic data.
-        self.interatomic.to_xml(doc, element)
+        self.interatomic.to_xml(doc, element, pipe_type=pipe_type)
 
         # Add the structural data, if it exists.
         if hasattr(self, 'structure'):

Modified: branches/double_rotor/specific_analyses/hybrid.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/double_rotor/specific_analyses/hybrid.py?rev=22261&r1=22260&r2=22261&view=diff
==============================================================================
--- branches/double_rotor/specific_analyses/hybrid.py (original)
+++ branches/double_rotor/specific_analyses/hybrid.py Mon Feb 24 10:00:57 2014
@@ -1,6 +1,6 @@
 
###############################################################################
 #                                                                            
 #
-# Copyright (C) 2006-2013 Edward d'Auvergne                                  
 #
+# Copyright (C) 2006-2014 Edward d'Auvergne                                  
 #
 #                                                                            
 #
 # This file is part of the program relax (http://www.nmr-relax.com).         
 #
 #                                                                            
 #
@@ -71,6 +71,25 @@
 
         # Store the pipe list forming the hybrid.
         cdp.hybrid_pipes = pipe_list
+
+
+    def data_names(self, set='all', scope=None, error_names=False, 
sim_names=False):
+        """Return a list of nothing.
+
+        @keyword set:           The set of object names to return.  This can 
be set to 'all' for all names, to 'generic' for generic object names, 
'params' for analysis specific parameter names, or to 'min' for minimisation 
specific object names.
+        @type set:              str
+        @keyword scope:         The scope of the parameter to return.  If 
not set, then all will be returned.  If set to 'global' or 'spin', then only 
the parameters within that scope will be returned.
+        @type scope:            str or None
+        @keyword error_names:   A flag which if True will add the error 
object names as well.
+        @type error_names:      bool
+        @keyword sim_names:     A flag which if True will add the Monte 
Carlo simulation object names as well.
+        @type sim_names:        bool
+        @return:                The list of object names.
+        @rtype:                 list of str
+        """
+
+        # Return an empty list.
+        return []
 
 
     def duplicate_data(self, pipe_from=None, pipe_to=None, model_info=None, 
global_stats=False, verbose=True):




Related Messages


Powered by MHonArc, Updated Mon Feb 24 10:40:02 2014