dpgen.database package

Submodules

dpgen.database.entry module

class dpgen.database.entry.Entry(composition, calculator, inputs, data, entry_id=None, attribute=None, tag=None)[source]

Bases: MSONable

An lightweight Entry object containing key computed data for storing purpose.

Attributes
number_element

Methods

as_dict()

A JSON serializable dict representation of an object.

from_dict(d)

param d

Dict representation.

to_json()

Returns a json string representation of the MSONable object.

unsafe_hash()

Returns an hash of the current object.

validate_monty(v)

pydantic Validator for MSONable pattern

as_dict()[source]

A JSON serializable dict representation of an object.

classmethod from_dict(d)[source]
Parameters

d – Dict representation.

Returns

MSONable class.

property number_element

dpgen.database.run module

dpgen.database.run.db_run(args)[source]
dpgen.database.run.parsing_gaussian(path, output='dpgen_db.json')[source]
dpgen.database.run.parsing_pwscf(path, output='dpgen_db.json')[source]
dpgen.database.run.parsing_vasp(path, config_info_dict, skip_init, output='dpgen_db.json', id_prefix=None)[source]

dpgen.database.vasp module

class dpgen.database.vasp.DPPotcar(symbols=None, functional='PBE', pp_file=None, pp_lists=None)[source]

Bases: MSONable

Methods

as_dict()

A JSON serializable dict representation of an object.

from_dict(d)

param d

Dict representation.

to_json()

Returns a json string representation of the MSONable object.

unsafe_hash()

Returns an hash of the current object.

validate_monty(v)

pydantic Validator for MSONable pattern

from_file

write_file

as_dict()[source]

A JSON serializable dict representation of an object.

classmethod from_dict(d)[source]
Parameters

d – Dict representation.

Returns

MSONable class.

classmethod from_file(filename)[source]
write_file(filename)[source]
class dpgen.database.vasp.VaspInput(incar, poscar, potcar, kpoints=None, optional_files=None, **kwargs)[source]

Bases: dict, MSONable

Class to contain a set of vasp input objects corresponding to a run.

Args:

incar: Incar object. kpoints: Kpoints object. poscar: Poscar object. potcar: Potcar object. optional_files: Other input files supplied as a dict of {

filename: object}. The object should follow standard pymatgen conventions in implementing a as_dict() and from_dict method.

Methods

as_dict()

A JSON serializable dict representation of an object.

clear()

copy()

from_dict(d)

param d

Dict representation.

from_directory(input_dir[, optional_files])

Read in a set of VASP input from a directory.

fromkeys(iterable[, value])

Create a new dictionary with keys from iterable and values set to value.

get(key[, default])

Return the value for key if key is in the dictionary, else default.

items()

keys()

pop(k[,d])

If key is not found, d is returned if given, otherwise KeyError is raised

popitem()

2-tuple; but raise KeyError if D is empty.

setdefault(key[, default])

Insert key with a value of default if key is not in the dictionary.

to_json()

Returns a json string representation of the MSONable object.

unsafe_hash()

Returns an hash of the current object.

update([E, ]**F)

If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]

validate_monty(v)

pydantic Validator for MSONable pattern

values()

write_input([output_dir, ...])

Write VASP input to a directory.

as_dict()[source]

A JSON serializable dict representation of an object.

classmethod from_dict(d)[source]
Parameters

d – Dict representation.

Returns

MSONable class.

static from_directory(input_dir, optional_files=None)[source]

Read in a set of VASP input from a directory. Note that only the standard INCAR, POSCAR, POTCAR and KPOINTS files are read unless optional_filenames is specified.

Args:

input_dir (str): Directory to read VASP input from. optional_files (dict): Optional files to read in as well as a

dict of {filename: Object type}. Object type must have a static method from_file.

write_input(output_dir='.', make_dir_if_not_present=True)[source]

Write VASP input to a directory.

Args:
output_dir (str): Directory to write to. Defaults to current

directory (“.”).

make_dir_if_not_present (bool): Create the directory if not

present. Defaults to True.