def parse(self, source=None, world=None): setup = self.setup if source is None: (setup.filename, source) = search_for_file(setup.stdfilename, world) if source is None: print """ You need to set the GPAW_SETUP_PATH environment variable to point to the directory where the setup files are stored. See http://wiki.fysik.dtu.dk/gpaw/install/installationguide.html for details.""" raise RuntimeError( 'Could not find %s-setup for "%s".' % (setup.name + '.' + setup.setupname, setup.symbol)) setup.fingerprint = md5_new(source).hexdigest() # XXXX There must be a better way! # We don't want to look at the dtd now. Remove it: source = re.compile(r'<!DOCTYPE .*?>', re.DOTALL).sub('', source, 1) xml.sax.parse(StringIO(source), self) # XXX There is a special parse # function that takes a string if setup.zero_reference: setup.e_total = 0.0 setup.e_kinetic = 0.0 setup.e_electrostatic = 0.0 setup.e_xc = 0.0
def parse(self, source=None, world=None): setup = self.setup if source is None: (setup.filename, source) = search_for_file(setup.stdfilename, world) if source is None: print """ You need to set the GPAW_SETUP_PATH environment variable to point to the directory where the setup files are stored. See http://wiki.fysik.dtu.dk/gpaw/install/installationguide.html for details.""" raise RuntimeError('Could not find %s-setup for "%s".' % (setup.name + '.' + setup.setupname, setup.symbol)) setup.fingerprint = md5_new(source).hexdigest() # XXXX There must be a better way! # We don't want to look at the dtd now. Remove it: source = re.compile(r'<!DOCTYPE .*?>', re.DOTALL).sub('', source, 1) xml.sax.parse(StringIO(source), self) # XXX There is a special parse # function that takes a string if setup.zero_reference: setup.e_total = 0.0 setup.e_kinetic = 0.0 setup.e_electrostatic = 0.0 setup.e_xc = 0.0
def build(self, xcfunc, lmax, basis, filter=None): if basis is None: basis = self.create_basis_functions() setup = PseudoPotential(self, basis) setup.fingerprint = md5_new(str(self.hghdata)).hexdigest() return setup