schrodinger.application.phase.packages.shape_binary_utils module¶
-
class
schrodinger.application.phase.packages.shape_binary_utils.
ShapeFileWriter
(filename, metadata='')¶ Bases:
contextlib.AbstractContextManager
-
__init__
(filename, metadata='')¶ Parameters: - filename (str) – File name (expected to exist if metadata is empty).
- metadata (str) – Text to be stored as file-scope “metadata”. If empty, “append” opening mode is assumed. If not empty, existing file with the same name will be truncated.
-
__exit__
(exc_type, exc_value, traceback)¶ Raise any exception triggered within the runtime context.
-
append
(title, shapes)¶ Appends
shapes
to the associated binary file.Parameters: - title (str) – Title of the shapes.
- shapes (list(shape.ShapeStructure)) – List of
shape.ShapeStructure
instances (may have different number of spheres).
-
__abstractmethods__
= frozenset()¶
-
__class__
¶ alias of
abc.ABCMeta
-
__delattr__
¶ Implement delattr(self, name).
-
__dict__
= mappingproxy({'__module__': 'schrodinger.application.phase.packages.shape_binary_utils', '__init__': <function ShapeFileWriter.__init__>, '__exit__': <function ShapeFileWriter.__exit__>, '_check': <function ShapeFileWriter._check>, 'append': <function ShapeFileWriter.append>, '__doc__': None, '__abstractmethods__': frozenset(), '_abc_registry': <_weakrefset.WeakSet object>, '_abc_cache': <_weakrefset.WeakSet object>, '_abc_negative_cache': <_weakrefset.WeakSet object>, '_abc_negative_cache_version': 49})¶
-
__dir__
() → list¶ default dir() implementation
-
__enter__
()¶ Return
self
upon entering the runtime context.
-
__eq__
¶ Return self==value.
-
__format__
()¶ default object formatter
-
__ge__
¶ Return self>=value.
-
__getattribute__
¶ Return getattr(self, name).
-
__gt__
¶ Return self>value.
-
__hash__
¶ Return hash(self).
-
__init_subclass__
()¶ This method is called when a class is subclassed.
The default implementation does nothing. It may be overridden to extend subclasses.
-
__le__
¶ Return self<=value.
-
__lt__
¶ Return self<value.
-
__module__
= 'schrodinger.application.phase.packages.shape_binary_utils'¶
-
__ne__
¶ Return self!=value.
-
__new__
()¶ Create and return a new object. See help(type) for accurate signature.
-
__reduce__
()¶ helper for pickle
-
__reduce_ex__
()¶ helper for pickle
-
__repr__
¶ Return repr(self).
-
__setattr__
¶ Implement setattr(self, name, value).
-
__sizeof__
() → int¶ size of object in memory, in bytes
-
__str__
¶ Return str(self).
-
classmethod
__subclasshook__
(C)¶ Abstract classes can override this to customize issubclass().
This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).
-
__weakref__
¶ list of weak references to the object (if defined)
-
-
class
schrodinger.application.phase.packages.shape_binary_utils.
ShapeFileReader
(filename, block_size=10000)¶ Bases:
contextlib.AbstractContextManager
-
__init__
(filename, block_size=10000)¶ Parameters: - filename (str) – File name.
- block_size (int) – Number of (title, structures) entries to read in one scoop.
-
__exit__
(exc_type, exc_value, traceback)¶ Raise any exception triggered within the runtime context.
-
metadata
¶ File-scope metadata from the associated “shape binary” file.
-
__iter__
()¶ Yields blocks of named blocks of shape structures.
Returns: Blocks of shapes and their titles. The titles
is a vector of (name, number-of-shape-structures) pairs, andshapes
is a vector of shape.ShapeStructure instances. len(shapes) == titles[0][1] + titles[1][1] + … + titles[N][1]Return type: (shape.ShapeStructureVector, shape.ShapeBlockTitleVector)
-
__abstractmethods__
= frozenset()¶
-
__class__
¶ alias of
abc.ABCMeta
-
__delattr__
¶ Implement delattr(self, name).
-
__dict__
= mappingproxy({'__module__': 'schrodinger.application.phase.packages.shape_binary_utils', '__init__': <function ShapeFileReader.__init__>, '__exit__': <function ShapeFileReader.__exit__>, 'metadata': <property object>, '__iter__': <function ShapeFileReader.__iter__>, '__doc__': None, '__abstractmethods__': frozenset(), '_abc_registry': <_weakrefset.WeakSet object>, '_abc_cache': <_weakrefset.WeakSet object>, '_abc_negative_cache': <_weakrefset.WeakSet object>, '_abc_negative_cache_version': 49})¶
-
__dir__
() → list¶ default dir() implementation
-
__enter__
()¶ Return
self
upon entering the runtime context.
-
__eq__
¶ Return self==value.
-
__format__
()¶ default object formatter
-
__ge__
¶ Return self>=value.
-
__getattribute__
¶ Return getattr(self, name).
-
__gt__
¶ Return self>value.
-
__hash__
¶ Return hash(self).
-
__init_subclass__
()¶ This method is called when a class is subclassed.
The default implementation does nothing. It may be overridden to extend subclasses.
-
__le__
¶ Return self<=value.
-
__lt__
¶ Return self<value.
-
__module__
= 'schrodinger.application.phase.packages.shape_binary_utils'¶
-
__ne__
¶ Return self!=value.
-
__new__
()¶ Create and return a new object. See help(type) for accurate signature.
-
__reduce__
()¶ helper for pickle
-
__reduce_ex__
()¶ helper for pickle
-
__repr__
¶ Return repr(self).
-
__setattr__
¶ Implement setattr(self, name, value).
-
__sizeof__
() → int¶ size of object in memory, in bytes
-
__str__
¶ Return str(self).
-
classmethod
__subclasshook__
(C)¶ Abstract classes can override this to customize issubclass().
This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).
-
__weakref__
¶ list of weak references to the object (if defined)
-