schrodinger.application.report2d module

Utilities for generating PDF and HTML 2D report files.

Copyright Schrodinger, LLC. All rights reserved.

class schrodinger.application.report2d.StructInfo(pic, width, height, labels, title)

Bases: object

Stores information that is needed to draw a structure to PDF/HTML. This includes the QPicture or image file path, picture dimentions, lables, and structure title.

__init__(pic, width, height, labels, title)

Initialize self. See help(type(self)) for accurate signature.

__class__

alias of builtins.type

__delattr__

Implement delattr(self, name).

__dict__ = mappingproxy({'__module__': 'schrodinger.application.report2d', '__doc__': '\n Stores information that is needed to draw a structure to PDF/HTML. This\n includes the QPicture or image file path, picture dimentions, lables, and\n structure title. ', '__init__': <function StructInfo.__init__>, '__dict__': <attribute '__dict__' of 'StructInfo' objects>, '__weakref__': <attribute '__weakref__' of 'StructInfo' objects>})
__dir__() → list

default dir() implementation

__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.report2d'
__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).

__subclasshook__()

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.report2d.PicturePrinter(printer, pictures, progress, num_cols, max_scale_factor)

Bases: object

Class for drawing structure pictures to a QPrinter for generating PDFs.

PAGE_MARGIN = 10
CELL_PADDING = 10
__init__(printer, pictures, progress, num_cols, max_scale_factor)
Parameters:
  • printer (QPrinter instance) – PDF printer to draw the pictures to.
  • pictures (List of StructInfo instances.) – Pictures to draw for each structure.
  • progress (QProgressDialog (or None if outside of Maestro)) – Progress dialog to update while drawing.
  • num_cols (int) – Number of columns to create in the PDF.
  • max_scale_factor (float) – This setting will set the limit on shrinking of smaller structures. So that, for example, benzens never take up the whole image.
run()

Execute the drawing.

__class__

alias of builtins.type

__delattr__

Implement delattr(self, name).

__dict__ = mappingproxy({'__module__': 'schrodinger.application.report2d', '__doc__': '\n Class for drawing structure pictures to a QPrinter for generating PDFs.\n ', 'PAGE_MARGIN': 10, 'CELL_PADDING': 10, '__init__': <function PicturePrinter.__init__>, '_calc_pic_size': <function PicturePrinter._calc_pic_size>, '_calc_row_height': <function PicturePrinter._calc_row_height>, '_draw_cell': <function PicturePrinter._draw_cell>, 'run': <function PicturePrinter.run>, '__dict__': <attribute '__dict__' of 'PicturePrinter' objects>, '__weakref__': <attribute '__weakref__' of 'PicturePrinter' objects>})
__dir__() → list

default dir() implementation

__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.report2d'
__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).

__subclasshook__()

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.report2d.Report2D(adaptor, renderer, render_model, app=None)

Bases: object

__init__(adaptor, renderer, render_model, app=None)

Initialize self. See help(type(self)) for accurate signature.

warning(msg)
generatePdf(sts, num_sts, outfile)

Generates a PDF document from the structures returned by the specified Structures iterator.

sts - Iterator that yields Structure objects.
You can pass structure.StructureReader(<file>)

num_sts - Number of structures

outfile - Name of the file to generate (must end with *.pdf)

generateHtml(sts, num_sts, outfile)

Generates an HTML document from the structures returned by the specified Structures iterator.

sts - Iterator that yields Structure objects.
You can pass structure.StructureReader(<file>)

num_sts - Number of structures

outfile - Name of the file to generate (must end with *.html)

generateXls(sts, num_sts, outfile)

Generates an Excel spreadsheet, which is basically just like HTML file, but with a different exteion and only one structure per row.

sts - Iterator that yields Structure objects.
You can pass structure.StructureReader(<file>)

num_sts - Number of structures

outfile - Name of the file to generate (must end with *.html)

__class__

alias of builtins.type

__delattr__

Implement delattr(self, name).

__dict__ = mappingproxy({'__module__': 'schrodinger.application.report2d', '__init__': <function Report2D.__init__>, '_savePicToFile': <function Report2D._savePicToFile>, '_generateHtml': <function Report2D._generateHtml>, '_generatePdf': <function Report2D._generatePdf>, '_generateImages': <function Report2D._generateImages>, '_generateReport': <function Report2D._generateReport>, 'warning': <function Report2D.warning>, 'generatePdf': <function Report2D.generatePdf>, 'generateHtml': <function Report2D.generateHtml>, 'generateXls': <function Report2D.generateXls>, '__dict__': <attribute '__dict__' of 'Report2D' objects>, '__weakref__': <attribute '__weakref__' of 'Report2D' objects>, '__doc__': None})
__dir__() → list

default dir() implementation

__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.report2d'
__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).

__subclasshook__()

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)