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

Class SmilesCsvWriter

                 object --+        
                          |        
_ReaderWriterContextManager --+    
                              |    
                    _BaseWriter --+
                                  |
                                 SmilesCsvWriter

More efficient writing of a large number of structures to a single SMILES CSV file.

Instance Methods [hide private]
 
__init__(self, filename, stereo=None, props=None)
x.__init__(...) initializes x; see help(type(x)) for signature
 
append(self, st)
Append the provided structure to the open SMILES CSV file.
 
_openWriter(self, propnames)
Open the CSV writer and write the header derived from the specified property names.
 
_writeRow(self, pattern, prop_dict)
Write a row to the CSV file, include all properties in self._ct_prop_names.
 
_getCtData(self, st)
 
close(self)
Close the file.
 
__del__(self)
Close the file when instance is deleted.

Inherited from _BaseWriter: setOption

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, stereo=None, props=None)
(Constructor)

 

x.__init__(...) initializes x; see help(type(x)) for signature

Parameters:
  • filename (str) - The filename to write to.
  • stereo (enum) - See the StructureWriter class for documentation on the allowed values.
  • props (list) - List of property names to export. If specified, then the CSV header is derived from this list, and structure lines are written by the append() method. If not specified, then CSV header will include all properties of all structures, and the output file will only be written when the close() method is called. (All structures will be cached in memory until flushed to disk.)
Overrides: object.__init__

Note: Excessive memory may be used by this class if the props argument is not specified and many structures are appended.