Package schrodinger :: Module structure :: Class SDReader
[hide private]
[frames] | no frames]

Class SDReader

                 object --+        
                          |        
_ReaderWriterContextManager --+    
                              |    
                   FormatReader --+
                                  |
                                 SDReader

A class for reading structures from a SD format file.

Instance Methods [hide private]
 
__init__(self, filename, index=1, error_handler=None, ignore_errors=False, input_string=None, import_sdprop_as_string=False, import_sdprop_per_file=True)
Initialize the reader.
 
getErrorHandler(self)
Returns the error handler by querying the mmmdl library and if the refcount is > 0 then return the error handler that is in use by mmmdl.
 
__del__(self)
 
close(self)
Close the file.
 
__iter__(self)
 
next(self)
Return the next Structure object from the file.

Inherited from FormatReader: clearReadErrors, getReadErrors, startErrorQueuing, stopErrorQueuing

Inherited from _ReaderWriterContextManager: __enter__, __exit__

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, filename, index=1, error_handler=None, ignore_errors=False, input_string=None, import_sdprop_as_string=False, import_sdprop_per_file=True)
(Constructor)

 

Initialize the reader.

Parameters:
  • filename (string) - The filename to read.
  • index (int) - The index of the first structure to read.
  • error_handler (int) - The handle of the mmerr object to use for error logging. Defaults to schrodinger.infra.mm.error_handler.
  • ignore_errors (bool) - If True, bad structures will be skipped instead of raising an exception.
  • input_string (string) - A string with the contents of an SD format file. If provided, the filename argument is ignored.
  • import_sdprop_as_string (bool) - Import all properties as strings. Setting this to True speeds file reading.
  • import_sdprop_per_file (bool) - Setting this to True indicates that all structures in the file will have the same set of properties. If this can be guaranteed, it speeds file reading.
Overrides: object.__init__

getErrorHandler(self)

 

Returns the error handler by querying the mmmdl library and if the refcount is > 0 then return the error handler that is in use by mmmdl. Otherwise None is returned.

Overrides: FormatReader.getErrorHandler