| Home | Trees | Indices | Help |
|
|---|
|
|
object --+
|
list --+
|
Structure
Structure --> group of atoms
Structure class is inherited from Python list. It contains
a list of Atom instances. Structure overloads setitem and setslice
methods so that the lattice attribute of atoms get set to lattice.
Data members:
title -- structure description
lattice -- coordinate system (instance of Lattice)
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
Inherited from Inherited from |
|||
|
|||
|
lattice Coordinate system for this Structure. |
|||
|
Inherited from |
|||
|
|||
define group of atoms in a specified lattice.
atoms -- list of Atom instances to be included in this Structure.
When atoms argument is an existing Structure instance,
the new Structure is its copy.
lattice -- instance of Lattice defining coordinate systems, property.
title -- string description of the structure
filename -- optional, name of a file to load the structure from.
Overrides atoms argument when specified.
Structure(stru) create a copy of Structure instance stru.
Because Structure is inherited from a list it can use list expansions,
for example:
oxygen_atoms = [ for a in stru if a.element == "O" ]
oxygen_stru = Structure(oxygen_atoms, lattice=stru.lattice)
|
Set idx-th atom to a.
idx -- index of atom in this Structure
a -- instance of Atom
copy -- flag for setting to a copy of a.
When False, set to a and update a.lattice.
No return value.
|
Set Structure slice from lo to hi-1 to the sequence of atoms.
lo -- low index for the slice
hi -- high index of the slice
atoms -- sequence of Atom instances
copy -- flag for using copies of Atom instances. When False, set
to existing instances and update their lattice attributes.
No return value.
|
simple string representation
|
Reset cached flag for a list of internal attributes. *args -- list of strings, currently supported are "labels" No return value. Raise AttributeError for any invalid args. |
Update the _labels dictionary of unique string labels of atoms. No return value. |
Add new Atom instance to the end of this Structure. All arguments are forwarded to Atom constructor. No return value. |
Append atom to a structure and update its lattice attribute.
a -- instance of Atom
copy -- flag for appending a copy of a.
When False, append a and update a.owner.
No return value.
|
Distance between 2 atoms, no periodic boundary conditions.
id0 -- zero based index of the first atom or a string label
such as "Na1"
id1 -- zero based index or string label of the second atom.
Return float.
Raise ValueError for invalid arguments.
|
Extend Structure by appending copies from a list of atoms.
atoms -- list of Atom instances
copy -- flag for extending with copies of Atom instances.
When False extend with atoms and update their lattice
attributes.
No return value.
|
Reference to internal Atom specified by the identifier.
id -- zero based index or a string label formatted as
"%(element)s%(order)i", for example "Na1", "Cl1"
Return Atom instance.
Raise ValueError for invalid id.
See also getLabels().
|
List of unique string labels for all atoms in this structure. Return a list. |
Insert atom a before position idx in this Structure.
idx -- position in atom list
a -- instance of Atom
copy -- flag for inserting a copy of a.
When False, append a and update a.lattice.
No return value.
|
place structure into new_lattice coordinate system sets lattice to new_lattice and recalculate fractional coordinates of all atoms so their absolute positions remain the same return self |
Load structure from a file, any original data become lost.
filename -- file to be loaded
format -- all structure formats are defined in Parsers submodule,
when format == 'auto' all Parsers are tried one by one
Return instance of data Parser used to process file. This
can be inspected for information related to particular format.
|
Load structure from a string, any original data become lost.
s -- string with structure definition
format -- all structure formats are defined in Parsers submodule,
when format == 'auto' all Parsers are tried one by one
Return instance of data Parser used to process input string. This
can be inspected for information related to particular format.
|
Save structure to file in the specified format
No return value.
Note: available structure formats can be obtained by:
from Parsers import formats
|
return string representation of the structure in specified format
Note: available structure formats can be obtained by:
from Parsers import formats
|
|
|||
latticeCoordinate system for this Structure.
|
| Home | Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0beta1 on Fri Apr 10 19:10:02 2009 | http://epydoc.sourceforge.net |