aiida_vasp.utils.aiida_utils#
Utils for AiiDA.
Utilities for making working against AiiDA a bit easier. Mostly here due to historical reasons when AiiDA was rapidly developed. In the future most routines that have now standardized in AiiDA will be removed.
Module Contents#
Functions#
Instantiates and returns a QueryBuilder instance. |
|
Provide access to the orm.data classes with deferred dbenv loading. |
|
Get current user. |
|
Assemble a new Dict. |
|
Displace a position in the StructureData. |
|
Apply compression or tensile forces to the unit cell. |
|
Load the verdi data click command group for any version since 0.11. |
|
Allow the current user to use the given computer. |
|
Get an existing authinfo or None for the given computer and current user. |
|
Decorator to load a node if it is passed as a string. |
|
Decorator to load a node if it is passed as a key word argument ends with ‘node’. |
|
Recursively convert the keys of a dictionary to lower or upper cases, returns a new dictionary. |
Data#
API#
- aiida_vasp.utils.aiida_utils.BASIC_DATA_TYPES: list[str] = ['core.bool', 'core.float', 'core.int', 'core.list', 'core.str', 'core.dict']#
- aiida_vasp.utils.aiida_utils.querybuild(cls: type, **kwargs: Any) aiida.orm.QueryBuilder[source]#
Instantiates and returns a QueryBuilder instance.
The QueryBuilder’s path has one vertice so far, namely this class. Additional parameters (e.g. filters or a label), can be passes as keyword arguments.
- Parameters:
label – Label to give
filters – filters to apply
project – projections
- Returns:
a QueryBuilder instance.
- aiida_vasp.utils.aiida_utils.get_data_class(data_type: str) type[source]#
Provide access to the orm.data classes with deferred dbenv loading.
- aiida_vasp.utils.aiida_utils.copy_parameter(old_parameter: aiida.orm.Dict) aiida.orm.Dict[source]#
Assemble a new Dict.
- aiida_vasp.utils.aiida_utils.displaced_structure(structure: aiida.orm.StructureData, displacement: numpy.ndarray, entry: int) aiida.orm.StructureData[source]#
- aiida_vasp.utils.aiida_utils.compressed_structure(structure: aiida.orm.StructureData, volume_change: float) aiida.orm.StructureData[source]#
- aiida_vasp.utils.aiida_utils.displace_position(structure: aiida.orm.StructureData, displacement: numpy.ndarray, entry: int) None[source]#
Displace a position in the StructureData.
- aiida_vasp.utils.aiida_utils.compress_cell(structure: aiida.orm.StructureData, volume_change: float) None[source]#
Apply compression or tensile forces to the unit cell.
- aiida_vasp.utils.aiida_utils.cmp_load_verdi_data() Any[source]#
Load the verdi data click command group for any version since 0.11.
- aiida_vasp.utils.aiida_utils.create_authinfo(computer: aiida.orm.Computer, store: bool = False) aiida.orm.AuthInfo[source]#
Allow the current user to use the given computer.
- aiida_vasp.utils.aiida_utils.cmp_get_authinfo(computer: aiida.orm.Computer) aiida.orm.AuthInfo | None[source]#
Get an existing authinfo or None for the given computer and current user.
- aiida_vasp.utils.aiida_utils.ensure_node_first_arg(func: Callable[..., Any]) Callable[..., Any][source]#
Decorator to load a node if it is passed as a string.
- aiida_vasp.utils.aiida_utils.ensure_node_kwargs(func: Callable[..., Any]) Callable[..., Any][source]#
Decorator to load a node if it is passed as a key word argument ends with ‘node’.
- aiida_vasp.utils.aiida_utils.convert_dict_case(dict_in: dict[str, Any], recursive: bool = True, warn: bool = False, lower: bool = True, raise_convert: bool = False) dict[str, Any][source]#
Recursively convert the keys of a dictionary to lower or upper cases, returns a new dictionary.
- Parameters:
dict_in – The input dictionary whose keys need to be converted.
recursive – If True, the function will recursively convert keys in nested dictionaries.
warn – If True, the function will print a warning if a key is converted.
lower – If True, convert keys to lowercase; otherwise, convert to uppercase.
raise_convert – If True, raise an error if a key is converted.
- Returns:
A new dictionary with keys converted to the specified case.