aiida_vasp.protocols.generator#
Input generators based on protocols
This module aimed at interactive post-generation update for the builder created by .get_builder_from_protocol method of various workchain classes.
Module Contents#
Classes#
Class to store the preset for inputs |
|
BaseClass for all protocol builder updaters |
|
Updater for VaspWorkChain’s builder |
|
Updater for VaspRelaxWorkChain’s builder |
|
Updater for VaspBandsWorkChain’s builder |
|
Updater for VaspConvergenceWorkChain |
|
Update for VaspHybridBandsWorkChain |
Functions#
Get the path where the YAML files are stored within this package. |
|
List all available presets in the package. |
|
Update a Dict node with new content. |
|
Convert INCAR tags to relax_settings and remove them from INCAR. |
|
Recursively search for Dict node with certain key |
|
Recursively search for Dict node with certain key |
|
Check if a dictionary is all empty |
Data#
API#
- aiida_vasp.protocols.generator.__all__ = ['VaspBandsInputGenerator', 'VaspConvergenceInputGenerator', 'VaspHybridBandsInputGenerator', 'VaspI...#
- aiida_vasp.protocols.generator.DEFAULT_PRESET = 'default_preset'#
- aiida_vasp.protocols.generator.DEFAULT_PROTOCOL = 'balanced'#
- aiida_vasp.protocols.generator.get_library_path() pathlib.Path[source]#
Get the path where the YAML files are stored within this package.
- Returns:
Path to the library directory containing YAML configuration files
- Return type:
- aiida_vasp.protocols.generator.list_protocol_presets() list[pathlib.Path][source]#
List all available presets in the package.
- class aiida_vasp.protocols.generator.PresetConfig[source]#
Class to store the preset for inputs
- classmethod from_file(fname: str) aiida_vasp.protocols.generator.PresetConfig[source]#
Load preset configuration from a YAML file.
Searches for the configuration file in the package library path and user’s home directory (~/.aiida-vasp/protocol_presets/).
- Parameters:
fname (str) – Name of the configuration file (without .yaml extension)
- Returns:
ProtocolPresetConfig instance loaded from file
- Return type:
ProtocolPresetConfig
- Raises:
RuntimeError – If the preset definition file cannot be found
- class aiida_vasp.protocols.generator.BaseInputGenerator(preset_name: str = 'default', protocol: str | None = None, verbose: bool = False)[source]#
BaseClass for all protocol builder updaters
The protocol updater serves two purposes: - Generating a builder based on a user-defined “preset”, e.g. with options and overrides pre-loaded - Allow interactive modifications of common parameters such as incar tag’s, resources and options.
Initialization
Instantiate a pipeline
- WF_ENTRYPOINT = 'vasp.vasp'#
- get_builder(structure, code=None, protocol=None, overrides=None, **kwargs)[source]#
Generate builder base on a given structure and overrides (if supplied)
- property reference_structure#
- set_incar(incar_updates=None, update_all=True, ports=None, namespace='incar', **kwargs)[source]#
Set incar dictionary
- set_options(option_updates=None, ports=None, update_all=True, **kwargs)[source]#
Set the options input port
- set_resources(resources_updates=None, ports=None, update_all=True, **kwargs)[source]#
Set the options input port
- _update_ports_by_base_name(value, port_basename, ports=None, update_all=True, merge=False, skip_empty=True)[source]#
Update a port by basename
- _update_dict_node(port, update: dict, dict_node=None, namespace=None, reuse_if_possible=True)[source]#
- _set_generic_port_by_dict(_port_name, value=None, ports=None, update_all=True, skip_empty=True, **kwargs)[source]#
Set a generic port by a value or kwargs
- _repr_pretty_(p, _=None) str[source]#
Pretty representation for in the IPython console and notebooks.
- set_kpoints_mesh(mesh: list[int], offset=(0.0, 0.0, 0.0), ports=None, update_all=True)[source]#
Set kpoints mesh
- set_potential_mapping(value=None, ports=None, update_all=True, **kwargs)[source]#
Set the potential mapping
- submit() aiida.orm.WorkChainNode[source]#
Submit the workflow to the daemon and return the workchain node.
- Returns:
The submitted workchain node
- Return type:
orm.WorkChainNode
- run_get_node(verbose: bool = True) aiida.orm.WorkChainNode[source]#
Run the workflow with the current python process.
- Parameters:
verbose (bool) – If True, print debugging information for failed calculations
- Returns:
Tuple containing the workflow outputs and the workchain node
- Return type:
orm.WorkChainNode
- _get_help(namespace: str, print_to_stdout: bool = True, inout: str = 'inputs') str | None[source]#
Return the help message for a given namespace.
The . syntax for the namespace is supported for nested namespaces.
- get_output_help(namespace: str, print_to_stdout: bool = True) str | None[source]#
Return the help message for a given output namespace.
- class aiida_vasp.protocols.generator.VaspInputGenerator(preset_name: str = 'default', protocol: str | None = None, verbose: bool = False)[source]#
Bases:
aiida_vasp.protocols.generator.BaseInputGeneratorUpdater for VaspWorkChain’s builder
Initialization
Instantiate a pipeline
- class aiida_vasp.protocols.generator.VaspRelaxInputGenerator(preset_name: str = 'default', protocol: str | None = None, verbose: bool = False)[source]#
Bases:
aiida_vasp.protocols.generator.BaseInputGeneratorUpdater for VaspRelaxWorkChain’s builder
Initialization
Instantiate a pipeline
- WF_ENTRYPOINT = 'vasp.relax'#
- class aiida_vasp.protocols.generator.VaspBandsInputGenerator(preset_name: str = 'default', protocol: str | None = None, verbose: bool = False)[source]#
Bases:
aiida_vasp.protocols.generator.BaseInputGeneratorUpdater for VaspBandsWorkChain’s builder
Initialization
Instantiate a pipeline
- WF_ENTRYPOINT = 'vasp.bands'#
- class aiida_vasp.protocols.generator.VaspConvergenceInputGenerator(preset_name: str = 'default', protocol: str | None = None, verbose: bool = False)[source]#
Bases:
aiida_vasp.protocols.generator.BaseInputGeneratorUpdater for VaspConvergenceWorkChain
Initialization
Instantiate a pipeline
- WF_ENTRYPOINT = 'vasp.converge'#
- class aiida_vasp.protocols.generator.VaspHybridBandsInputGenerator(preset_name: str = 'default', protocol: str | None = None, verbose: bool = False)[source]#
Bases:
aiida_vasp.protocols.generator.VaspBandsInputGeneratorUpdate for VaspHybridBandsWorkChain
Initialization
Instantiate a pipeline
- WF_ENTRYPOINT = 'vasp.hybrid_bands'#
- aiida_vasp.protocols.generator.update_dict_node(node: aiida.orm.Dict, content: dict[str, Any], namespace: str | None = None, reuse_if_possible: bool = True) aiida.orm.Dict[source]#
Update a Dict node with new content.
Optionally updates a specific namespace within the Dict node. If the node is stored and immutable, creates a new node with updated content.
- Parameters:
- Returns:
Updated Dict node (may be the same or a new node)
- Return type:
orm.Dict
- aiida_vasp.protocols.generator.incar_dict_to_relax_settings(incar_in: dict[str, Any]) tuple[dict[str, Any], dict[str, Any]][source]#
Convert INCAR tags to relax_settings and remove them from INCAR.
Extracts relaxation-specific INCAR parameters (NSW, IBRION, EDIFFG) and converts them to equivalent relax_settings options.
- aiida_vasp.protocols.generator.recursive_search_dict_with_key(namespace, search_key)[source]#
Recursively search for Dict node with certain key