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

Class SDWriter

                 object --+        
                          |        
_ReaderWriterContextManager --+    
                              |    
                    _BaseWriter --+
                                  |
                                 SDWriter

A class for more efficient appending of a large number of structures to a single SD structure file.

For writing single structures, just use the Structure.write method. For appending a small (less than a thousand) number of structures, the Structure.append method will perform acceptably.

Instance Methods [hide private]
 
__init__(self, filename, overwrite=True)
Initialize needed mmlibs and open the file 'filename'.
 
setOption(self, option, value)
Set an option not supported for all StructureWriter formats.
 
append(self, ct)
Append the provided structure to the open file.
 
close(self)
Close the file.
 
__del__(self)
Close the file and terminate the mmlibs.

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, overwrite=True)
(Constructor)

 

Initialize needed mmlibs and open the file 'filename'.

Note that the file will not be completely written until it is explicitly closed or the object is garbage collected.

Parameters:
  • filename (str) - The filename to write to.
  • overwrite (bool) - If False, append to an existing file if it exists.
Overrides: object.__init__

setOption(self, option, value)

 

Set an option not supported for all StructureWriter formats.

The only supported option for SDWriter is stereo. See the StructureWriter docstring for details on the option values.

Parameters:
  • option - The name of the option to set.
  • value - The value for the option. The data type of this parameter depends on the option being set.
Overrides: _BaseWriter.setOption