Package schrodinger :: Module surface :: Class SurfaceDict
[hide private]
[frames] | no frames]

Class SurfaceDict

collections.MutableMapping --+
                             |
                            SurfaceDict

A dictionary of {surface name: ProjectSurface object} for the specified project row. Note that surfaces may not be created by assignment to a dictionary value. Use add, {addFromFile}, or schrodinger.project.ProjectRow.newMolecularSurface instead. SurfaceDict objects are typically accessed via schrodinger.project.ProjectRow.surface.

Instance Methods [hide private]
 
__init__(self, proj, row)
@param proj: The project @type proj: L{schrodinger.project.Project}
 
__len__(self)
 
__getitem__(self, name)
 
__setitem__(self, key, value)
 
__delitem__(self, name)
 
__iter__(self)
ProjectSurface
add(self, surf, overwrite=True, copy=False)
Add an existing Surface object to the project row.
ProjectSurface
addFromFile(self, filename, name=None, overwrite=True)
Read a surface from a file and add it to the project row.
Method Details [hide private]

__init__(self, proj, row)
(Constructor)

 

@param proj: The project
@type proj: L{schrodinger.project.Project}

@param row: The project row
@type row: L{schrodinger.project.ProjectRow

add(self, surf, overwrite=True, copy=False)

 

Add an existing Surface object to the project row. Note that if copy is False (the default), this method will invalidate the input Surface object, as the mmsurf handle will be managed by the project.

Parameters:
  • surf (Surface) - The surface to add.
  • overwrite (bool) - What to do if the new surface has the same name as an existing surface for this project row. If True, the existing surface will be overwritten. In False, a ValueError will be raised.
  • copy (bool) - If True, a copy of the surface will be added to the project and the input surface will not be invalidated.
Returns: ProjectSurface
A ProjectSurface object for the added surface.

addFromFile(self, filename, name=None, overwrite=True)

 

Read a surface from a file and add it to the project row.

Parameters:
  • filename (str) - The file to read
  • name (str) - If given, the surface will be renamed to this before being loaded into the project.
  • overwrite (bool) - What to do if the new surface has the same name as an existing surface for this project row. If True, the existing surface will be overwritten. In False, a ValueError will be raised.
Returns: ProjectSurface
A ProjectSurface object for the added surface.