dpgen.database package#
- class dpgen.database.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)Args:
get_partial_json
([json_kwargs, pickle_kwargs])load
(file_path)Loads a class from a provided json file.
save
(json_path[, mkdir, json_kwargs, ...])Utility that uses the standard tools of MSONable to convert the class to json format, but also save it to disk.
to_json
()Returns a json string representation of the MSONable object.
unsafe_hash
()Returns an hash of the current object.
validate_monty_v1
(_MSONable__input_value)Pydantic validator with correct signature for pydantic v1.x
validate_monty_v2
(_MSONable__input_value, _)Pydantic validator with correct signature for pydantic v2.x
from_file
write_file
- class dpgen.database.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.
- Parameters:
- compositionComposition
Composition of the entry. For flexibility, this can take the form of all the typical input taken by a Composition, including a {symbol: amt} dict, a string formula, and others.
- inputsdict
An dict of parameters associated with the entry. Defaults to None.
- datadict
An dict of any additional data associated with the entry. Defaults to None.
- entry_idobj
An optional id to uniquely identify the entry.
- attribute
Optional attribute of the entry. This can be used to specify that the entry is a newly found compound, or to specify a particular label for the entry, or else … Used for further analysis and plotting purposes. An attribute can be anything but must be MSONable.
- Attributes:
- number_element
Methods
as_dict
()A JSON serializable dict representation of an object.
from_dict
(d)Args:
get_partial_json
([json_kwargs, pickle_kwargs])load
(file_path)Loads a class from a provided json file.
save
(json_path[, mkdir, json_kwargs, ...])Utility that uses the standard tools of MSONable to convert the class to json format, but also save it to disk.
to_json
()Returns a json string representation of the MSONable object.
unsafe_hash
()Returns an hash of the current object.
validate_monty_v1
(_MSONable__input_value)Pydantic validator with correct signature for pydantic v1.x
validate_monty_v2
(_MSONable__input_value, _)Pydantic validator with correct signature for pydantic v2.x
- property number_element#
- class dpgen.database.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)Args:
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.
get_partial_json
([json_kwargs, pickle_kwargs])items
()keys
()load
(file_path)Loads a class from a provided json file.
pop
(key[, default])If the key is not found, return the default if given; otherwise, raise a KeyError.
popitem
(/)Remove and return a (key, value) pair as a 2-tuple.
save
(json_path[, mkdir, json_kwargs, ...])Utility that uses the standard tools of MSONable to convert the class to json format, but also save it to disk.
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_v1
(_MSONable__input_value)Pydantic validator with correct signature for pydantic v1.x
validate_monty_v2
(_MSONable__input_value, _)Pydantic validator with correct signature for pydantic v2.x
values
()write_input
([output_dir, ...])Write VASP input to a directory.
- 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.
- Parameters:
- input_dirstr
Directory to read VASP input from.
- optional_filesdict
Optional files to read in as well as a dict of {filename: Object type}. Object type must have a static method from_file.
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.
- Parameters:
- compositionComposition
Composition of the entry. For flexibility, this can take the form of all the typical input taken by a Composition, including a {symbol: amt} dict, a string formula, and others.
- inputsdict
An dict of parameters associated with the entry. Defaults to None.
- datadict
An dict of any additional data associated with the entry. Defaults to None.
- entry_idobj
An optional id to uniquely identify the entry.
- attribute
Optional attribute of the entry. This can be used to specify that the entry is a newly found compound, or to specify a particular label for the entry, or else … Used for further analysis and plotting purposes. An attribute can be anything but must be MSONable.
- Attributes:
- number_element
Methods
as_dict
()A JSON serializable dict representation of an object.
from_dict
(d)Args:
get_partial_json
([json_kwargs, pickle_kwargs])load
(file_path)Loads a class from a provided json file.
save
(json_path[, mkdir, json_kwargs, ...])Utility that uses the standard tools of MSONable to convert the class to json format, but also save it to disk.
to_json
()Returns a json string representation of the MSONable object.
unsafe_hash
()Returns an hash of the current object.
validate_monty_v1
(_MSONable__input_value)Pydantic validator with correct signature for pydantic v1.x
validate_monty_v2
(_MSONable__input_value, _)Pydantic validator with correct signature for pydantic v2.x
- property number_element#
dpgen.database.run module#
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)Args:
get_partial_json
([json_kwargs, pickle_kwargs])load
(file_path)Loads a class from a provided json file.
save
(json_path[, mkdir, json_kwargs, ...])Utility that uses the standard tools of MSONable to convert the class to json format, but also save it to disk.
to_json
()Returns a json string representation of the MSONable object.
unsafe_hash
()Returns an hash of the current object.
validate_monty_v1
(_MSONable__input_value)Pydantic validator with correct signature for pydantic v1.x
validate_monty_v2
(_MSONable__input_value, _)Pydantic validator with correct signature for pydantic v2.x
from_file
write_file
- 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)Args:
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.
get_partial_json
([json_kwargs, pickle_kwargs])items
()keys
()load
(file_path)Loads a class from a provided json file.
pop
(key[, default])If the key is not found, return the default if given; otherwise, raise a KeyError.
popitem
(/)Remove and return a (key, value) pair as a 2-tuple.
save
(json_path[, mkdir, json_kwargs, ...])Utility that uses the standard tools of MSONable to convert the class to json format, but also save it to disk.
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_v1
(_MSONable__input_value)Pydantic validator with correct signature for pydantic v1.x
validate_monty_v2
(_MSONable__input_value, _)Pydantic validator with correct signature for pydantic v2.x
values
()write_input
([output_dir, ...])Write VASP input to a directory.
- 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.
- Parameters:
- input_dirstr
Directory to read VASP input from.
- optional_filesdict
Optional files to read in as well as a dict of {filename: Object type}. Object type must have a static method from_file.