pyiron_atomistics.vasp.base.Kpoints#
- class pyiron_atomistics.vasp.base.Kpoints(input_file_name=None, table_name='kpoints')[source]#
Bases:
GenericParametersClass to control the KPOINTS file of a vasp simulation
Methods
__init__([input_file_name, table_name])Clears all fields in the object
define_blocks(block_dict)Define a block section within the GenericParameters
from_dict(obj_dict[, version])Populate the object from the serialized object.
from_hdf(hdf[, group_name])Restore the GenericParameters from an HDF5 file
get(parameter_name[, default_value])Get the value of a specific parameter from GenericParameters - if the parameter is not available return default_value if that is set.
get_attribute(attribute_name)Get the value of a specific parameter from GenericParameters
Output the GenericParameters object as Pandas Dataframe for human readability.
Get list of strings from GenericParameters to write to input file
instantiate(obj_dict[, version])Create a blank instance of this class.
keys()Return keys of GenericParameters object
Loads the default file content
load_string(input_str)Load a multi line string to overwrite the current parameter settings
modify([separator, append_if_not_present])Modify values for existing parameters.
read_input(file_name[, ignore_trigger])Read input file and store the data in GenericParameters - this overwrites the current parameter settings
remove_keys(key_list)Remove a list of keys from the GenericParameters
set([separator])Set the value of multiple parameters or create new parameter key, if they do not exist already.
set_dict(dictionary)Set a dictionary of key value pairs
set_kmesh_by_density(structure)set_kpoints_file([method, size_of_mesh, ...])Sets appropriate tags and values in the KPOINTS file :param method: Type of meshing scheme (Gamma, MP, Manual or Line) :type method: str :param size_of_mesh: List of size 1x3 specifying the required mesh size :type size_of_mesh: list/numpy.ndarray :param shift: List of size 1x3 specifying the user defined shift from the Gamma point :type shift: list :param n_path: Number of points per trace for line mode :type n_path: int :param path: List of tuples including path coorinate and name.
set_value(line, val)Set the value of a parameter in a specific line
to_dict()Reduce the object to a dictionary.
to_hdf(hdf[, group_name])Store the GenericParameters in an HDF5 file
write_file(file_name[, cwd])Write GenericParameters to input file
Attributes
Get the separator that characterizes comment
Get the special character at the end of every line
Get the file name of the input file
Get the multi word separator to have multi word keys
Get the dictionary to replace certain character combinations
Get the separator that characterizes the split between key and value
Get the name of the input table inside the HDF5 file
Get the boolean option to switch from a key value list to an value only input file
- clear_all() None#
Clears all fields in the object
- property comment_char: str | None#
Get the separator that characterizes comment
- Returns:
comment character
- Return type:
str
- define_blocks(block_dict: Dict[str, List[str]]) None#
Define a block section within the GenericParameters
- Parameters:
block_dict (dict) – dictionary to define the block
- property end_value_char: str | None#
Get the special character at the end of every line
- Returns:
end of line character
- Return type:
str
- property file_name: str | None#
Get the file name of the input file
- Returns:
file name
- Return type:
str
- from_dict(obj_dict: dict, version: str = None)#
Populate the object from the serialized object.
- Parameters:
obj_dict (dict) – data previously returned from
to_dict()version (str) – version tag written together with the data
- from_hdf(hdf, group_name=None)[source]#
Restore the GenericParameters from an HDF5 file
- Parameters:
hdf (ProjectHDFio) – HDF5 group object
group_name (str) – HDF5 subgroup name - optional
- get(parameter_name: str, default_value: str | None = None) str | None#
Get the value of a specific parameter from GenericParameters - if the parameter is not available return default_value if that is set.
- Parameters:
parameter_name (str) – parameter key
default_value (str) – default value to return is the parameter is not set
- Returns:
value of the parameter
- Return type:
str
- get_attribute(attribute_name: str) str | None#
Get the value of a specific parameter from GenericParameters
- Parameters:
attribute_name (str) – parameter key
- Returns:
value of the parameter
- Return type:
str
- get_pandas() DataFrame#
Output the GenericParameters object as Pandas Dataframe for human readability.
- Returns:
Pandas Dataframe of the GenericParameters object
- Return type:
pandas.DataFrame
- get_string_lst() List[str]#
Get list of strings from GenericParameters to write to input file
- Returns:
List of strings representing the GenericParameters object
- Return type:
List[str]
- classmethod instantiate(obj_dict: dict, version: str = None) Self#
Create a blank instance of this class.
This can be used when some values are already necessary for the objects __init__.
- Parameters:
obj_dict (dict) – data previously returned from
to_dict()version (str) – version tag written together with the data
- Returns:
a blank instance of the object that is sufficiently initialized to call
_from_dict()on it- Return type:
object
- keys() List[str]#
Return keys of GenericParameters object
- load_string(input_str: str) None#
Load a multi line string to overwrite the current parameter settings
- Parameters:
input_str (str) – multi line string
- modify(separator: str | None = None, append_if_not_present: bool = False, **modify_dict: str | bool) None#
Modify values for existing parameters. The command is called as modify(param1=val1, param2=val2, …)
- Parameters:
separator (str) – needed if the parameter name contains special characters such as par: use then as input: modify(separator=”:”, par=val) - optional
append_if_not_present (bool) – do not raise an exception but append the parameter in practice use set(par=val) - default=False
**modify_dict (dict) – dictionary of parameter names and values
- property multi_word_separator: str | None#
Get the multi word separator to have multi word keys
- Returns:
multi word separator
- Return type:
str
- read_input(file_name: str, ignore_trigger: str | None = None) None#
Read input file and store the data in GenericParameters - this overwrites the current parameter settings
- Parameters:
file_name (str) – absolute path to the input file
ignore_trigger (str) – trigger for lines to be ignored
- remove_keys(key_list: List[str]) None#
Remove a list of keys from the GenericParameters
- Parameters:
key_list (list) – list of keys to be removed
- property replace_char_dict: Dict[str, str] | None#
Get the dictionary to replace certain character combinations
- Returns:
character replace dictionary
- Return type:
dict
- property separator_char: str | None#
Get the separator that characterizes the split between key and value
- Returns:
separator character
- Return type:
str
- set(separator: str | None = None, **set_dict: str | bool) None#
Set the value of multiple parameters or create new parameter key, if they do not exist already.
- Parameters:
separator (float/int/str) – separator string - optional
**set_dict (dict) – dictionary containing the parameter keys and their corresponding values to be set
- set_dict(dictionary: Dict[str, str | bool]) None#
Set a dictionary of key value pairs
- Parameters:
dictionary (dict) – dictionary of key value pairs
- set_kpoints_file(method=None, size_of_mesh=None, shift=None, n_path=None, path=None)[source]#
Sets appropriate tags and values in the KPOINTS file :param method: Type of meshing scheme (Gamma, MP, Manual or Line) :type method: str :param size_of_mesh: List of size 1x3 specifying the required mesh size :type size_of_mesh: list/numpy.ndarray :param shift: List of size 1x3 specifying the user defined shift from the Gamma point :type shift: list :param n_path: Number of points per trace for line mode :type n_path: int :param path: List of tuples including path coorinate and name. :type path: list
- set_value(line: int, val: str | bytes) None#
Set the value of a parameter in a specific line
- Parameters:
line (float/int/str) – line number - starting with 0
val (str/bytes) – value to be set
- property table_name: str | None#
Get the name of the input table inside the HDF5 file
- Returns:
table name
- Return type:
str
- to_dict() dict#
Reduce the object to a dictionary.
- Returns:
serialized state of this object
- Return type:
dict
- to_hdf(hdf, group_name=None)[source]#
Store the GenericParameters in an HDF5 file
- Parameters:
hdf (ProjectHDFio) – HDF5 group object
group_name (str) – HDF5 subgroup name - optional
- property val_only: bool | None#
Get the boolean option to switch from a key value list to an value only input file
- Returns:
[True/False]
- Return type:
bool
- write_file(file_name: str, cwd: str | None = None) None#
Write GenericParameters to input file
- Parameters:
file_name (str) – name of the file, either absolute (then cwd must be None) or relative
cwd (str) – path name (default: None)