schrodinger.application.matsci.nano.surfaces_interfaces_mod module

Classes and functions to enumerate surfaces and interfaces.

Copyright Schrodinger, LLC. All rights reserved.

schrodinger.application.matsci.nano.surfaces_interfaces_mod.get_base_names(ref_xtal_asu, ref_base_name_in=None, ads_xtal_asu=None, ads_base_name_in=None)

Return the reference, adsorption, and final combined base names.

Parameters:
  • ref_xtal_asu (str) – reference xtal input file
  • ref_base_name_in (str or None) – reference base name or None if none has been given
  • ads_xtal_asu (str or None) – adsorption xtal input file or None if none has been given
  • ads_base_name_in (str or None) – adsorption base name or None if none has been given
Return type:

str, str or None, str

Returns:

reference, adsorption, and final combined base names, the adsorption base name will be None if no adsorption xtal asu is provided

class schrodinger.application.matsci.nano.surfaces_interfaces_mod.ParserWrapper(scriptname, description)

Bases: object

Manages the argparse module to parse user command line arguments.

__init__(scriptname, description)

Create a ParserWrapper instance and process it.

Parameters:
  • scriptname (str) – name of this script
  • description (str) – description of this script
loadIt()

Load ParserWrapper with options.

parseArgs(args)

Parse the command line arguments.

Parameters:args (tuple) – command line arguments
__class__

alias of builtins.type

__delattr__

Implement delattr(self, name).

__dict__ = mappingproxy({'__module__': 'schrodinger.application.matsci.nano.surfaces_interfaces_mod', '__doc__': '\n Manages the argparse module to parse user command line\n arguments.\n ', '__init__': <function ParserWrapper.__init__>, 'loadIt': <function ParserWrapper.loadIt>, 'parseArgs': <function ParserWrapper.parseArgs>, '__dict__': <attribute '__dict__' of 'ParserWrapper' objects>, '__weakref__': <attribute '__weakref__' of 'ParserWrapper' 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.matsci.nano.surfaces_interfaces_mod'
__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)

schrodinger.application.matsci.nano.surfaces_interfaces_mod.get_word_list_from_file(afile)

Return a list of words from the given file.

Parameters:afile (str) – file name
Return type:list
Returns:contains words from the given file
schrodinger.application.matsci.nano.surfaces_interfaces_mod.get_surface_kwargs(options_file)

Return a dictionary of surface options from the given options file.

Parameters:options_file (str or None) – contains options for the surface build or None if there are none in which case the defaults are used
Return type:dict
Returns:contains options for the surface build
schrodinger.application.matsci.nano.surfaces_interfaces_mod.get_interface_kwargs(options_file)

Return a dictionary of interface options from the given options file.

Parameters:options_file (str or None) – contains options for the interface build or None if there are none in which case the defaults are used
Return type:dict
Returns:contains options for the interface build
class schrodinger.application.matsci.nano.surfaces_interfaces_mod.Surfaces(xtal_asu, surface_kwargs=None, logger=None)

Bases: object

Manage the enumeration of surfaces.

__init__(xtal_asu, surface_kwargs=None, logger=None)

Create an instance.

Parameters:
  • xtal_asu (schrodinger.structure.Structure) – the crystalline ASU from which to create surfaces
  • surface_kwargs (None or dict) – kwargs for the surface build or None if there are none in which case the defaults will be used
  • logger (logging.Logger or None) – output logger or None if there isn’t one
getHKLIndices()

Collect and return all hkl Miller index triples for this surface enumeration and sort them according to increasing l then k then h.

Raises:ValueError – if there are zero valid hkl triples
Return type:list
Returns:contains sorted tuples of hkl triples
getSurface(cell, hkl, logger=None)

Build and return a slab.Surface.

Parameters:
  • cell (schrodinger.structure.Structure) – a cell
  • hkl (tuple) – a triple of Miller indices
  • logger (logging.Logger or None) – output logger or None if there isn’t one
Return type:

slab.Surface

Returns:

the surface object

logParams()

Log the parameters.

getXtalCell()

Build and return the crystal cell from which surfaces will be created.

Return type:schrodinger.structure.Structure
Returns:the crystal cell
getSurfaces()

Build and return the slab.Surface objects for all surfaces.

Return type:list of slab.Surface
Returns:contains surface objects
writeSurfaces(file_name)

Write surfaces to a Maestro file with the given file name.

Parameters:file_name (str) – file name of the Maestro file
runIt()

Create the surfaces.

__class__

alias of builtins.type

__delattr__

Implement delattr(self, name).

__dict__ = mappingproxy({'__module__': 'schrodinger.application.matsci.nano.surfaces_interfaces_mod', '__doc__': '\n Manage the enumeration of surfaces.\n ', '__init__': <function Surfaces.__init__>, 'getHKLIndices': <function Surfaces.getHKLIndices>, 'getSurface': <function Surfaces.getSurface>, 'logParams': <function Surfaces.logParams>, 'getXtalCell': <function Surfaces.getXtalCell>, 'getSurfaces': <function Surfaces.getSurfaces>, 'writeSurfaces': <function Surfaces.writeSurfaces>, 'runIt': <function Surfaces.runIt>, '__dict__': <attribute '__dict__' of 'Surfaces' objects>, '__weakref__': <attribute '__weakref__' of 'Surfaces' 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.matsci.nano.surfaces_interfaces_mod'
__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.matsci.nano.surfaces_interfaces_mod.Interfaces(ref_surfaces, ads_surfaces, interface_kwargs=None, logger=None)

Bases: object

Manage the enumeration of interfaces.

__init__(ref_surfaces, ads_surfaces, interface_kwargs=None, logger=None)

Create an instance.

Parameters:
  • ref_surfaces (list of schrodinger.structure.Structure) – reference surface ASUs from which interfaces will be created
  • ads_surfaces (list of schrodinger.structure.Structure) – adsorption surface ASUs from which interfaces will be created
  • interface_kwargs (None or dict) – kwargs for the interface builds or None if there are none in which case the defaults will be used
  • logger (logging.Logger or None) – output logger or None if there isn’t one
logParams()

Log the parameters.

getInterface(ref_surface, ads_surface)

Build and return a interface_mod.Interface.

Parameters:
Return type:

interface_mod.Interface

Returns:

the interface object

getInterfaces()

Build and return the interface_mod.Interface objects for all interfaces.

Return type:list of interface_mod.Interface
Returns:contains interface objects
writeInterfaces(file_name)

Write interfaces to a Maestro file with the given file name.

Parameters:file_name (str) – file name of the Maestro file
runIt()

Create the interfaces.

__class__

alias of builtins.type

__delattr__

Implement delattr(self, name).

__dict__ = mappingproxy({'__module__': 'schrodinger.application.matsci.nano.surfaces_interfaces_mod', '__doc__': '\n Manage the enumeration of interfaces.\n ', '__init__': <function Interfaces.__init__>, 'logParams': <function Interfaces.logParams>, 'getInterface': <function Interfaces.getInterface>, 'getInterfaces': <function Interfaces.getInterfaces>, 'writeInterfaces': <function Interfaces.writeInterfaces>, 'runIt': <function Interfaces.runIt>, '__dict__': <attribute '__dict__' of 'Interfaces' objects>, '__weakref__': <attribute '__weakref__' of 'Interfaces' 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.matsci.nano.surfaces_interfaces_mod'
__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.matsci.nano.surfaces_interfaces_mod.SurfacesInterfaces(ref_xtal_asu, ref_surface_kwargs=None, ads_xtal_asu=None, ads_surface_kwargs=None, interface_kwargs=None, logger=None)

Bases: object

Manage the enumeration of surfaces and interfaces.

__init__(ref_xtal_asu, ref_surface_kwargs=None, ads_xtal_asu=None, ads_surface_kwargs=None, interface_kwargs=None, logger=None)

Create an instance.

Parameters:
  • ref_xtal_asu (schrodinger.structure.Structure) – the crystalline ASU from which to create reference surfaces
  • ref_surface_kwargs (None or dict) – kwargs for the reference surface build or None if there are none in which case the defaults will be used
  • ads_xtal_asu (None or schrodinger.structure.Structure) – the crystalline ASU from which to create adsorption surfaces or None if interfaces are not needed
  • ads_surface_kwargs (None or dict) – kwargs for the adsorption surface build or None if there are none in which case the defaults will be used
  • interface_kwargs (None or dict) – kwargs for the interface build or None if there are none in which case the defaults will be used
  • logger (logging.Logger or None) – output logger or None if there isn’t one
__class__

alias of builtins.type

__delattr__

Implement delattr(self, name).

__dict__ = mappingproxy({'__module__': 'schrodinger.application.matsci.nano.surfaces_interfaces_mod', '__doc__': '\n Manage the enumeration of surfaces and interfaces.\n ', '__init__': <function SurfacesInterfaces.__init__>, 'checkInput': <function SurfacesInterfaces.checkInput>, 'createSurfaces': <function SurfacesInterfaces.createSurfaces>, 'createInterfaces': <function SurfacesInterfaces.createInterfaces>, 'runIt': <function SurfacesInterfaces.runIt>, '__dict__': <attribute '__dict__' of 'SurfacesInterfaces' objects>, '__weakref__': <attribute '__weakref__' of 'SurfacesInterfaces' 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.matsci.nano.surfaces_interfaces_mod'
__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)

checkInput()

Check input.

Raises:ValueError – if any input crystal ASU is missing any lattice parameter structure properties
createSurfaces()

Create the surfaces.

Raises:ValueError – if something goes wrong with either surface build
createInterfaces()

Create the interfaces.

runIt()

Create the surfaces and interfaces.