Package diffpy :: Package Structure :: Package Parsers :: Module structureparser :: Class StructureParser
[hide private]
[frames] | no frames]

Class StructureParser

source code

Known Subclasses:
P_rawxyz.P_rawxyz, P_xyz.P_xyz, P_bratoms.P_bratoms, P_xcfg.P_xcfg, P_cif.P_cif, P_pdb.P_pdb, P_discus.P_discus, P_pdffit.P_pdffit, P_auto.P_auto

Base class for all structure parsers.

Data members:
    format   -- format of particular parser
    filename -- path to structure file that is read or written



Instance Methods [hide private]
 
__init__(self) source code
 
parse(self, s)
Create Structure instance from a string.
source code
 
parseFile(self, filename)
Create Structure instance from an existing file.
source code
 
parseLines(self, lines)
Create Structure instance from a list of lines.
source code
 
toLines(self, stru)
Convert Structure stru to a list of lines.
source code
 
tostring(self, stru)
Convert Structure instance to a string.
source code
Method Details [hide private]

parse(self, s)

source code 
Create Structure instance from a string.

Return Structure object or raise StructureFormatError exception.

parseFile(self, filename)

source code 
Create Structure instance from an existing file.

filename  -- path to structure file

Return Structure object.
Raise StructureFormatError or IOError.

parseLines(self, lines)

source code 
Create Structure instance from a list of lines.

Return Structure object or raise StructureFormatError exception.
This method has to be overloaded in derived class.

toLines(self, stru)

source code 
Convert Structure stru to a list of lines.
This method has to be overloaded in derived class.

Return list of strings.