mailr9692 - in /branches/bmrb: generic_fns/bmrb.py prompt/bmrb.py


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

Header


Content

Posted by edward on October 09, 2009 - 13:24:
Author: bugman
Date: Fri Oct  9 13:24:34 2009
New Revision: 9692

URL: http://svn.gna.org/viewcvs/relax?rev=9692&view=rev
Log:
Introduced the version arg to the bmrb.read() user function.

This is mainly useful for debugging.


Modified:
    branches/bmrb/generic_fns/bmrb.py
    branches/bmrb/prompt/bmrb.py

Modified: branches/bmrb/generic_fns/bmrb.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/bmrb/generic_fns/bmrb.py?rev=9692&r1=9691&r2=9692&view=diff
==============================================================================
--- branches/bmrb/generic_fns/bmrb.py (original)
+++ branches/bmrb/generic_fns/bmrb.py Fri Oct  9 13:24:34 2009
@@ -47,8 +47,8 @@
     write_function(sys.stdout, version=version)
 
 
-def read(file=None, directory=None):
-    """Read the contents of a BMRB NMR-STAR v3.1 formatted file."""
+def read(file=None, directory=None, version='3.1'):
+    """Read the contents of a BMRB NMR-STAR formatted file."""
 
     # Test if the current data pipe exists.
     if not ds.current_pipe:
@@ -69,11 +69,11 @@
     read_function = get_specific_fn('bmrb_read', 
ds[ds.current_pipe].pipe_type)
 
     # Read the results.
-    read_function(file_path)
+    read_function(file_path, version=version)
 
 
 def write(file=None, directory=None, version='3.1', force=False):
-    """Create a BMRB NMR-STAR v3.1 formatted file."""
+    """Create a BMRB NMR-STAR formatted file."""
 
     # Test if the current data pipe exists.
     if not ds.current_pipe:

Modified: branches/bmrb/prompt/bmrb.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/bmrb/prompt/bmrb.py?rev=9692&r1=9691&r2=9692&view=diff
==============================================================================
--- branches/bmrb/prompt/bmrb.py (original)
+++ branches/bmrb/prompt/bmrb.py Fri Oct  9 13:24:34 2009
@@ -50,8 +50,8 @@
         bmrb.display(version=version)
 
 
-    def read(self, file=None, dir=None):
-        """Read BMRB files in the NMR-STAR v3.1 format.
+    def read(self, file=None, dir=None, version='3.1'):
+        """Read BMRB files in the NMR-STAR format.
 
         Keyword Arguments
         ~~~~~~~~~~~~~~~~~
@@ -71,15 +71,17 @@
         if self.__relax__.interpreter.intro:
             text = sys.ps3 + "bmrb.read("
             text = text + "file=" + repr(file)
-            text = text + ", dir=" + repr(dir) + ")"
+            text = text + ", dir=" + repr(dir)
+            text = text + ", version=" + repr(version) + ")"
             print(text)
 
         # The argument checks.
         check.is_str(file, 'file name')
         check.is_str(dir, 'directory name', can_be_none=True)
+        check.is_str(version, 'NMR-STAR dictionary version')
 
         # Execute the functional code.
-        bmrb.read(file=file, directory=dir)
+        bmrb.read(file=file, directory=dir, version=version)
 
 
     def write(self, file=None, dir='pipe_name', version='3.1', force=False):




Related Messages


Powered by MHonArc, Updated Fri Oct 09 13:40:02 2009