Package schrodinger :: Package application :: Package matsci :: Package espresso :: Module utils :: Class UPFParser
[hide private]
[frames] | no frames]

Class UPFParser

object --+
         |
        UPFParser

Class that handles UPF parsing.

Instance Methods [hide private]
 
__init__(self, path)
Initialize UPFParser.
str
_parseUPF2Prop(self, line)
Get value of the property from line of a UPF2 file.
 
_parseUPF2(self, upf_fh)
Parse UPF version 2 file and set related attributes.
str
_parseUPFProp(self, line)
Get value of the property from line of a UPF file.
 
_parseUPF(self, upf_fh)
Parse UPF version 1 file and set related attributes.
str
_checkElement(self, element)
Check that element is known by mm infrastructure.
str
_checkType(self, pp_type)
Check that pseudopotential type is known by our infrastructure.
bool
_checkRelativistic(self, rel_str)
Check if pseudo is fully relativistic.

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  PP_TYPES = ('1/r', 'US', 'NC', 'PAW')
  FULLY_REL = 'full'
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, path)
(Constructor)

 

Initialize UPFParser.

Parameters:
  • path (str) - Path to the UPF file
Overrides: object.__init__

_parseUPF2Prop(self, line)

 

Get value of the property from line of a UPF2 file.

Parameters:
  • line (str)
Returns: str
Parsed property

_parseUPF2(self, upf_fh)

 

Parse UPF version 2 file and set related attributes.

Parameters:
  • upf_fh (file handler) - File handler to UPF

_parseUPFProp(self, line)

 

Get value of the property from line of a UPF file.

Parameters:
  • line (str)
Returns: str
Parsed property

_parseUPF(self, upf_fh)

 

Parse UPF version 1 file and set related attributes.

Parameters:
  • upf_fh (file handler) - File handler to UPF

_checkElement(self, element)

 

Check that element is known by mm infrastructure.

Parameters:
  • element (str) - Element name
Returns: str
If element is know return element name, otherwise empty string

_checkType(self, pp_type)

 

Check that pseudopotential type is known by our infrastructure.

Parameters:
  • pp_type (str) - Pseudopotential type
Returns: str
If pseudopotential type is know return pseudopotential type, otherwise empty string

_checkRelativistic(self, rel_str)

 

Check if pseudo is fully relativistic.

Parameters:
  • rel_str (str) - Relativistic type
Returns: bool
If pseudo is fully relativistic return True, otherwise False