Package schrodinger :: Package application :: Package matsci :: Package nano :: Module particle
[hide private]
[frames] | no frames]

Module particle

Classes and functions to create nanoparticles.

Copyright Schrodinger, LLC. All rights reserved.

Classes [hide private]
  ParserWrapper
Manages the argparse module to parse user command line arguments.
  CheckInput
Manage checking user input.
  Nanoparticle
Manage the building of a nanoparticle.
Functions [hide private]
 
dict_to_str(x)
list of str
get_lattice_properties()
Get the properties which are required for defining a crystal structure
bool
check_if_lattice_properties_exist(struct, keys=None)
Check if the structure has all the required crystal lattice properties
str
format_alignment_ids(num_unique)
Return a formatted collection of shapes and alignment axis IDs.
tuple
group_subtuples_by_key_and_value(atuple)
Take a tuple of two-element subtuples and group them by both key and value and collect into subsubtuples.
dict
build_kwargs(kwargs_list, defaults, acceptable_keys=None, token_separator=',', key_value_separator='=', all_choices=None)
Build the kwargs dictionary from an unformatted and unvalidated list of kwargs.
 
set_representation(astructure)
Set the representation of the given structure.
Variables [hide private]
  __doc__ = ...
  _version = '$Revision 0.0 $'
  DEFAULT_SHAPE = 'cube'
  ALL_SHAPES = ['cube', 'tetrahedron', 'octahedron', 'dodecahedr...
  OUTFILE_SUFFIX = '-out'
  FRAGMENT_NAME = 'FRAGMENT_NAME'
  TERM_FRAG = 'hydrogen'
  TERM_FRAGS = ['none', 'hydrogen', 'oxide', 'hydroxyl', 'fluoro...
  TERM_DICT = OrderedDict([('none', ['', '']), ('hydrogen', ['',...
  TERM_DIRECTION = 'forward'
  TERM_BOND_LENGTH = 1.5
  NANOPARTICLE_NATOMS_KEY = 'i_matsci_Nanoparticle_Natoms'
  NANOPARTICLE_VOLUME_KEY = 'r_matsci_Volume/Ang.^3'
  NANOPARTICLE_SURFACE_AREA_KEY = 'r_matsci_Surface_Area/Ang.^2'
  NANOPARTICLE_CIRCUMRADIUS_KEY = 'r_matsci_Circumradius/Ang.'
  NANOPARTICLE_DENSITY_KEY = 'r_matsci_Density/g/cm^3'
  NANOPARTICLE_TEMPLATE = 'b_matsci_Nanoparticle_Template'
  ORIGINAL_ATOM_KEY = 'b_matsci_np_gui_original_atom'
  NUM_DECIMAL = 4
  CM_TO_ANGSTROM = 100000000.0
  TOKEN_SEPARATOR = ','
hash(x)
  KEY_VALUE_SEPARATOR = '='
  AXIS_KEY = 'axis'
  VECTOR_KEY = 'vector'
  BASIS_KEY = 'basis'
  HKL_VALUE = 'hkl'
  ABC_VALUE = 'abc'
  XYZ_VALUE = 'xyz'
  ALIGNMENT_KEYS = ['axis', 'vector', 'basis']
  BASIS_VALUES = ['hkl', 'abc', 'xyz']
  PRIMARY_ALIGNMENT_DEFAULT = OrderedDict([('axis', '1'), ('vect...
  SECONDARY_ALIGNMENT_DEFAULT = OrderedDict([('axis', '1'), ('ve...
  PRIMARY_ALIGNMENT_DEFAULT_LIST = ['axis=1,vector=1.0 0.0 0.0,b...
  SECONDARY_ALIGNMENT_DEFAULT_LIST = ['axis=1,vector=0.0 1.0 0.0...
  INCLUDE_AXES_DEFAULT = False
hash(x)
  VERTICES_DEFAULT = []
  ALLOW_FRAGMENTS = False
hash(x)
  __package__ = 'schrodinger.application.matsci.nano'
Function Details [hide private]

get_lattice_properties()

 

Get the properties which are required for defining a crystal structure

Returns: list of str
Each item in the list is a structure property that is required to be present if a crystal structure is defined

check_if_lattice_properties_exist(struct, keys=None)

 

Check if the structure has all the required crystal lattice properties

Parameters:
  • struct (schrodinger.structure.Structure) - The structure to check
  • keys (list) - The list of crystal properties to check. If not given, the default set of crystal properties from get_lattice_properties will be checked
Returns: bool
If all the requested properties are present on the structure

format_alignment_ids(num_unique)

 

Return a formatted collection of shapes and alignment axis IDs.

Parameters:
  • num_unique (str) - the shape attr to format
Returns: str
the formatted string

group_subtuples_by_key_and_value(atuple)

 

Take a tuple of two-element subtuples and group them by both key and value and collect into subsubtuples. For example, take ((1, 2), (1, 3), (4, 5), (6, 7), (8, 7)) and return (((1), (2, 3)), ((4), (5)), ((6, 8), (7))).

Parameters:
  • atuple (tuple) - contains two-element tuples
Returns: tuple
contains two-element tuples each of which contains a keys tuple and a values tuple

build_kwargs(kwargs_list, defaults, acceptable_keys=None, token_separator=',', key_value_separator='=', all_choices=None)

 

Build the kwargs dictionary from an unformatted and unvalidated list of kwargs.

Parameters:
  • kwargs_list (list) - list of strings that contain kwargs in one form or another
  • defaults (dict) - default kwargs to be updated
  • acceptable_keys (list) - list of acceptable keys
  • token_separator (str) - the separator used for tokens
  • key_value_separator (str) - the separator used in key-value pairs
  • all_choices (dict) - if the values of certain keys are limited then collect those options here in lists for validation purposes
Returns: dict
dictionary of kwargs, formatted, validated, and contains unspecified defaults

set_representation(astructure)

 

Set the representation of the given structure.

Parameters:

Variables Details [hide private]

__doc__

Value:
"""
Classes and functions to create nanoparticles.

Copyright Schrodinger, LLC. All rights reserved."""

ALL_SHAPES

Value:
['cube',
 'tetrahedron',
 'octahedron',
 'dodecahedron',
 'icosahedron',
 'cubeoctahedron',
 'slab',
 'parallelepiped',
...

TERM_FRAGS

Value:
['none',
 'hydrogen',
 'oxide',
 'hydroxyl',
 'fluoro',
 'chloro',
 'bromo',
 'carbonyl',
...

TERM_DICT

Value:
OrderedDict([('none', ['', '']), ('hydrogen', ['', '']), ('oxide', ['o\
rganic', 'Hydroxide']), ('hydroxyl', ['organic', 'Hydroxyl']), ('fluor\
o', ['diverse_fragments', 'fluoro']), ('chloro', ['diverse_fragments',\
 'chloro']), ('bromo', ['diverse_fragments', 'bromo']), ('carbonyl', [\
'organic', 'Carbonyl']), ('methyl', ['organic', 'Methyl']), ('carboxyl\
', ['organic', 'Acid(C->O)']), ('amine', ['organic', 'Amine']), ('plan\
ar amine', ['organic', 'Planar_Amine']), ('silyl', ['organic', 'Silyl'\
]), ('thiol', ['organic', 'Thiol']), ('phosphyl', ['organic', 'Phosphy\
...

PRIMARY_ALIGNMENT_DEFAULT

Value:
OrderedDict([('axis', '1'), ('vector', '1.0 0.0 0.0'), ('basis', 'hkl'\
)])

SECONDARY_ALIGNMENT_DEFAULT

Value:
OrderedDict([('axis', '1'), ('vector', '0.0 1.0 0.0'), ('basis', 'abc'\
)])

PRIMARY_ALIGNMENT_DEFAULT_LIST

Value:
['axis=1,vector=1.0 0.0 0.0,basis=hkl']

SECONDARY_ALIGNMENT_DEFAULT_LIST

Value:
['axis=1,vector=0.0 1.0 0.0,basis=abc']