aiida_vasp.common.builder_updater#

This module provides a set of updater classes and utility functions for constructing and managing AiiDA process builders for VASP-based workflows. The updaters encapsulate logic for applying presets, setting calculation options, managing input sets, and updating workflow-specific settings for various VASP workchains, including standard calculations, relaxations, NEB, convergence tests, and band structure calculations.

Key Classes:

  • VaspPresetConfig: Handles loading and managing preset configurations from YAML files.

  • BaseBuilderUpdater: Base class for builder updaters, providing common methods for builder manipulation.

  • VaspBuilderUpdater: Updater for standard VASP calculations.

  • VaspNEBUpdater: Updater for NEB (nudged elastic band) calculations.

  • VaspRelaxUpdater: Updater for relaxation workflows.

  • VaspMultiStageRelaxUpdater: Updater for multi-stage relaxation workflows.

  • VaspConvUpdater: Updater for convergence testing workflows.

  • VaspBandUpdater: Updater for band structure workflows.

  • VaspHybridBandUpdater: Updater for hybrid functional band structure workflows.

Key Utilities:

  • update_dict_node: Utility to safely update AiiDA Dict nodes.

  • builder_to_dict: Converts a builder to a Python dictionary for inspection.

  • incar_dict_to_relax_settings: Extracts relaxation settings from INCAR parameters.

  • is_specified: Checks if any values are set in a ProcessBuilderNamespace.

The module is designed to facilitate programmatic and reproducible setup of VASP workflows in AiiDA, supporting both interactive and automated use cases.

Module Contents#

Classes#

VaspPresetConfig

Class to store the preset for VaspBuilderUpdater

BaseBuilderUpdater

Base class for builder updater

VaspBuilderUpdater

VaspNEBUpdater

VaspRelaxUpdater

An updater for VaspRelaxWorkChain

VaspMultiStageRelaxUpdater

An updater for VaspRelaxWorkChain

VaspConvUpdater

Update for VaspConvergenceWorkChain

VaspBandUpdater

Updater for VaspBandsWorkChain

VaspHybridBandUpdater

Updater for VaspHybridBandsWorkChain

Functions#

get_library_path

Get the path where the YAML files are stored within this package.

list_presets

List all available presets in the package.

is_specified

Check if there is anything specified under a PortNamespace.

update_dict_node

Update a Dict node with new content.

builder_to_dict

Convert a builder to a dictionary and optionally unpack certain nodes.

incar_dict_to_relax_settings

Convert INCAR tags to relax_settings and remove them from INCAR.

Data#

API#

aiida_vasp.common.builder_updater.DEFAULT_PRESET = 'VaspPreset'#
aiida_vasp.common.builder_updater.DEFAULT_INPUTSET = 'UCLRelaxSet'#
aiida_vasp.common.builder_updater.__all__ = ('VaspBandUpdater', 'VaspBuilderUpdater', 'VaspConvUpdater', 'VaspHybridBandUpdater', 'VaspNEBUpdate...#
aiida_vasp.common.builder_updater.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:

pathlib.Path

aiida_vasp.common.builder_updater.list_presets() list[pathlib.Path][source]#

List all available presets in the package.

aiida_vasp.common.builder_updater.OPTIONS_TEMPLATES = None#
class aiida_vasp.common.builder_updater.VaspPresetConfig[source]#

Class to store the preset for VaspBuilderUpdater

name: str = None#
inputset: str = None#
default_code: str = None#
code_specific: dict = 'field(...)'#
default_options: dict = 'field(...)'#
default_settings: dict = 'field(...)'#
default_inputset_overrides: dict = 'field(...)'#
default_relax_settings: dict = 'field(...)'#
default_band_settings: dict = 'field(...)'#
classmethod from_file(fname: str) aiida_vasp.common.builder_updater.VaspPresetConfig[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).

Parameters:

fname (str) – Name of the configuration file (without .yaml extension)

Returns:

VaspPresetConfig instance loaded from file

Return type:

VaspPresetConfig

Raises:

RuntimeError – If the preset definition file cannot be found

get_code_specific_options(code: str, namespace: str) dict[str, Any][source]#

Return code-specific options for a given namespace.

If code-specific options exist, they are merged with the default options for the namespace, with code-specific options taking precedence.

Parameters:
  • code (str) – Name/identifier of the computational code

  • namespace (str) – Configuration namespace (e.g., ‘options’, ‘settings’)

Returns:

Dictionary containing the merged options

Return type:

dict

class aiida_vasp.common.builder_updater.BaseBuilderUpdater(preset_name: str | None = None, builder: aiida.engine.processes.builder.ProcessBuilder | None = None, verbose: bool = False, inputset_name: str | None = None, set_name: str | None = None)[source]#

Base class for builder updater

Initialization

Instantiate a pipeline

property builder: aiida.engine.processes.builder.ProcessBuilder#

The builder to be used for launching the calculation.

Returns:

Process builder instance

Return type:

ProcessBuilder

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.

Parameters:
  • namespace (str) – Namespace path (e.g., ‘vasp.parameters’)

  • print_to_stdout (bool) – Whether to print help to stdout or return it

  • inout (str) – Whether to get help for ‘inputs’ or ‘outputs’

Returns:

Help message if print_to_stdout is False, otherwise None

Return type:

str or None

get_output_help(namespace: str, print_to_stdout: bool = True) str | None[source]#

Return the help message for a given output namespace.

Parameters:
  • namespace (str) – Output namespace path

  • print_to_stdout (bool) – Whether to print help to stdout or return it

Returns:

Help message if print_to_stdout is False, otherwise None

Return type:

str or None

get_input_help(namespace: str, print_to_stdout: bool = True) str | None[source]#

Return the help message for a given input namespace.

Parameters:
  • namespace (str) – Input namespace path

  • print_to_stdout (bool) – Whether to print help to stdout or return it

Returns:

Help message if print_to_stdout is False, otherwise None

Return type:

str or None

class aiida_vasp.common.builder_updater.VaspBuilderUpdater(preset_name: str | None = None, builder: aiida.engine.processes.builder.ProcessBuilder | None = None, root_namespace: aiida.engine.processes.builder.ProcessBuilderNamespace | None = None, code: str | None = None, verbose: bool = False, inputset_name: str | None = None)[source]#

Bases: aiida_vasp.common.builder_updater.BaseBuilderUpdater

WF_ENTRYPOINT = 'vasp.v2.vasp'#
DEFAULT_INPUTSET = None#
property reference_structure: aiida.orm.StructureData#

Reference structure used for setting kpoints and other calculations.

Returns:

The structure data node used as reference

Return type:

orm.StructureData

clear() None[source]#

Clear all nodes set in the VASP and root namespaces.

Resets parameters, options, settings, kpoints, potential family/mapping, structure, and metadata label to None.

apply_preset(initial_structure: aiida.orm.StructureData, code: str | None = None, label: str | None = None, overrides: dict[str, Any] | None = None, inputset_name: str | None = None) aiida_vasp.common.builder_updater.VaspBuilderUpdater[source]#

Apply the complete preset configuration to the builder.

This method applies the input set, sets the computational code, options, settings, and label according to the preset configuration.

Parameters:
  • initial_structure (orm.StructureData) – Structure to be used for the calculation

  • code (str or None) – Computational code to use (defaults to preset default)

  • label (str or None) – Label for the calculation (defaults to structure label)

  • overrides (dict or None) – Dictionary of parameter overrides

  • inputset_name (str or None) – Name of input set to use (defaults to preset default)

Returns:

Self for method chaining

Return type:

VaspBuilderUpdater

use_inputset(structure: aiida.orm.StructureData, set_name: str | None = None, overrides: dict[str, Any] | None = None, apply_preset: bool = False, code: str | None = None, structure_port_name: str = 'structure', pmg_kwargs: dict[str, Any] | None = None) aiida_vasp.common.builder_updater.VaspBuilderUpdater[source]#

Update the inputs ports for the VASP calculation.

Parameters:
  • structure – The structure to be used for the calculation.

  • set_name – The name of the input set to be used.

  • overrides – Any overrides to be applied to the input set.

  • apply_preset – Whether to apply the preset options.

  • code – The code to be used for the calculation.

  • structure_node_name – The name of in put port where the structure should be set.

  • pmg_kwargs – Additional kwargs to be passed to pymatgen’s InputSet when using a pymatgen inputset.

:returns : self, the VaspBuilderUpdater instance with the input set applied.

set_kspacing(kspacing: float) aiida_vasp.common.builder_updater.VaspBuilderUpdater[source]#

Set the k-point spacing and remove any existing k-point mesh.

Parameters:

kspacing (float) – K-point spacing value in inverse Angstroms

Returns:

Self for method chaining

Return type:

VaspBuilderUpdater

set_potential_family(family: str) aiida_vasp.common.builder_updater.VaspBuilderUpdater[source]#

Set the potential family for the VASP calculation.

Parameters:

family (str) – Name of the potential family

Returns:

Self for method chaining

Return type:

VaspBuilderUpdater

set_potential_mapping(mapping: dict[str, str]) aiida_vasp.common.builder_updater.VaspBuilderUpdater[source]#

Set the potential mapping for the VASP calculation.

Parameters:

mapping (dict[str, str]) – Dictionary mapping element symbols to potential names

Returns:

Self for method chaining

Return type:

VaspBuilderUpdater

update_kspacing = None#
property parameters: Union[aiida.orm.Dict, None]#

Return the parameters node containing INCAR settings.

Returns:

Parameters node or None if not set

Return type:

orm.Dict or None

property settings: Union[aiida.orm.Dict, None]#

Return the settings node for VASP calculation options.

Returns:

Settings node or None if not set

Return type:

orm.Dict or None

set_code(code: str | aiida.orm.Code | None = None) aiida_vasp.common.builder_updater.VaspBuilderUpdater[source]#

Set the Code for the VASP calculation.

Parameters:

code (str, orm.Code, or None) – Code identifier string or Code node (defaults to preset default)

Returns:

Self for method chaining

Return type:

VaspBuilderUpdater

update_code(code: str | aiida.orm.Code) aiida_vasp.common.builder_updater.VaspBuilderUpdater[source]#
set_incar(*args: Any, **kwargs: Any) aiida_vasp.common.builder_updater.VaspBuilderUpdater[source]#

Update INCAR parameters for the VASP calculation.

Parameters:
  • args – Positional arguments passed to dict constructor

  • kwargs – INCAR parameter key-value pairs

Returns:

Self for method chaining

Return type:

VaspBuilderUpdater

update_incar(*args: Any, **kwargs: Any) aiida_vasp.common.builder_updater.VaspBuilderUpdater[source]#
set_options(*args: Any, code: str | None = None, apply_preset: bool = False, **kwargs: Any) aiida_vasp.common.builder_updater.VaspBuilderUpdater[source]#

Set computational options for the VASP calculation.

Parameters:
  • args – Positional arguments passed to dict constructor

  • code (str or None) – Code name for code-specific options

  • apply_preset (bool) – Whether to apply preset-defined options

  • kwargs – Option key-value pairs

Returns:

Self for method chaining

Return type:

VaspBuilderUpdater

update_options(*args: Any, **kwargs: Any) aiida_vasp.common.builder_updater.VaspBuilderUpdater[source]#
set_kpoints_mesh(mesh: list[int], offset: list[float] = (0.0, 0.0, 0.0)) aiida_vasp.common.builder_updater.VaspBuilderUpdater[source]#

Set explicit k-points mesh for the calculation. The plugin generates the KPOINTS file with a Gamma-centered mesh. Monkhorst-Pack meshes can be applied by using the offset parameter, e.g. (0.5, 0.5, 0.5)

Parameters:
  • mesh (List[int]) – K-point mesh dimensions [nx, ny, nz]

  • offset (List[float]) – K-point mesh offset [ox, oy, oz]

Returns:

Self for method chaining

Return type:

VaspBuilderUpdater

update_kpoints_mesh(mesh: list[int], offset: list[float]) aiida_vasp.common.builder_updater.VaspBuilderUpdater[source]#
set_settings(*args: Any, code: str | None = None, apply_preset: bool = False, **kwargs: Any) aiida_vasp.common.builder_updater.VaspBuilderUpdater[source]#

Set the ‘settings’ input port.

Parameters:
  • args – Positional arguments passed to dict constructor

  • code (str or None) – Code name for code-specific settings

  • apply_preset (bool) – Whether to apply preset-defined settings

  • kwargs – Setting key-value pairs

Returns:

Self for method chaining

Return type:

VaspBuilderUpdater

update_settings(*args: Any, **kwargs: Any) aiida_vasp.common.builder_updater.VaspBuilderUpdater[source]#
set_label(label: str | None = None) aiida_vasp.common.builder_updater.VaspBuilderUpdater[source]#

Set the top-level label for the calculation.

Parameters:

label (str or None) – Label string (defaults to structure label if available)

Returns:

Self for method chaining

Return type:

VaspBuilderUpdater

update_label(label: str | None = None) aiida_vasp.common.builder_updater.VaspBuilderUpdater[source]#
set_resources(**kwargs: Any) aiida_vasp.common.builder_updater.VaspBuilderUpdater[source]#

Update computational resources in the options. NOTE: The available options can be found in the documentation of the Calculation class. These are identical to those used in the metadata.options namespace.

Parameters:
  • args – Positional arguments passed to dict constructor

  • kwargs – Resource key-value pairs

Returns:

Self for method chaining

Return type:

VaspBuilderUpdater

Raises:

RuntimeError – If options are not set before calling this method

update_resources(*args: Any, **kwargs: Any) aiida_vasp.common.builder_updater.VaspBuilderUpdater[source]#
_set_options(option_class: type, option_name: str, target_namespace: aiida.engine.processes.builder.ProcessBuilder | aiida.engine.processes.builder.ProcessBuilderNamespace, **kwargs: Any) aiida_vasp.common.builder_updater.VaspBuilderUpdater[source]#

Set options using a specific option class.

Parameters:
  • option_class – Class used to validate and structure options

  • option_name (str) – Name of the option attribute in the target namespace

  • target_namespace (ProcessBuilder or ProcessBuilderNamespace) – Namespace where options should be set

  • kwargs – Option key-value pairs

Returns:

Self for method chaining

class aiida_vasp.common.builder_updater.VaspNEBUpdater(preset_name: str | None = None, builder: aiida.engine.processes.builder.ProcessBuilder | None = None, root_namespace: aiida.engine.processes.builder.ProcessBuilderNamespace | None = None, code: str | None = None, verbose: bool = False, inputset_name: str | None = None)[source]#

Bases: aiida_vasp.common.builder_updater.VaspBuilderUpdater

WF_ENTRYPOINT = 'vasp.neb'#
property reference_structure#

Return the reference structure for NEB calculations.

Returns:

Initial structure for NEB calculation

Return type:

orm.StructureData

apply_preset(structure_init: aiida.orm.StructureData, structure_final: aiida.orm.StructureData, code: str | None = None, label: str | None = None, interpolate: bool = True, nimages: int = 5, **kwargs: Any) aiida_vasp.common.builder_updater.VaspNEBUpdater[source]#
use_inputset(initial_structure: aiida.orm.StructureData, set_name: str | None = None, overrides: dict[str, Any] | None = None, apply_preset: bool = False, code: str | None = None) aiida_vasp.common.builder_updater.VaspNEBUpdater[source]#
set_label(label: str | None = None) aiida_vasp.common.builder_updater.VaspNEBUpdater[source]#

Set the toplevel label, default to the label of the structure

set_final_structure(final_structure: aiida.orm.StructureData) aiida_vasp.common.builder_updater.VaspNEBUpdater[source]#

Set the final structure for NEB calculation.

Parameters:

final_structure (orm.StructureData) – Final structure for the NEB path

Returns:

Self for method chaining

Return type:

VaspNEBUpdater

set_neb_images(images: list | dict | aiida.common.extendeddicts.AttributeDict) aiida_vasp.common.builder_updater.VaspNEBUpdater[source]#

Set the intermediate NEB images.

Parameters:

images (list, dict, or AttributeDict) – List of structures or dictionary mapping image names to structures

Returns:

Self for method chaining

Return type:

VaspNEBUpdater

set_interpolated_images(nimages: int) aiida_vasp.common.builder_updater.VaspNEBUpdater[source]#

Generate and set interpolated images between initial and final structures.

This requires the initial and final structures to be set already. Also updates the final image with PBC issues fixed.

Parameters:

nimages (int) – Number of intermediate images to generate

Returns:

Self for method chaining

Return type:

VaspNEBUpdater

view_images(*args: Any, **kwargs: Any) None[source]#

Visualize the NEB images using ASE viewer.

Displays all images including initial, intermediate, and final structures.

Hint: In a notebook environment, you can pass “viewer=’weas’” to use weas-widget viewer. This requires the ase-weas-widget package to be installed.

class aiida_vasp.common.builder_updater.VaspRelaxUpdater(preset_name: str | None = None, builder: aiida.engine.processes.builder.ProcessBuilder | None = None, override_vasp_namespace: aiida.engine.processes.builder.ProcessBuilderNamespace | None = None, namespace_relax: aiida.engine.processes.builder.ProcessBuilderNamespace | None = None, code: str | None = None)[source]#

Bases: aiida_vasp.common.builder_updater.VaspBuilderUpdater

An updater for VaspRelaxWorkChain

Initialization

Initialise the update object.

Parameters:
  • builder – The ProcessBuilder or ProcessBuilderNamespace to be used for setting standard VaspWorkChain inputs.

  • root_namespace – The namespace to be assumed to be the root, e.g. where the input structure should be specified. The v2 series of workchain in aiida-vasp usually has the StructureData input port at the top level interface, although there are a few exceptions.

  • preset_name – The name of the Preset to be used for the updater.

  • code – The code to be used for the calculation. If not specified, the default code from the preset will be used.

  • verbose – If True, print additional information during the update.

  • set_name – The name of the input set to be used. If not specified, the default input set from the preset will be used.

returns: An instance of VaspBuilderUpdater with the specified preset and builder.

WF_ENTRYPOINT = 'vasp.v2.relax'#
use_inputset(*args: Any, set_name: str | None = None, **kwargs: Any) aiida_vasp.common.builder_updater.VaspRelaxUpdater[source]#
apply_preset(structure: aiida.orm.StructureData, code: str | None = None, label: str | None = None, **kwargs: Any) aiida_vasp.common.builder_updater.VaspRelaxUpdater[source]#
set_relax_settings(**kwargs: Any) aiida_vasp.common.builder_updater.VaspRelaxUpdater[source]#

Set/update RelaxOptions controlling the operation of the workchain.

Parameters:

kwargs – Relaxation option key-value pairs

Returns:

Self for method chaining

Return type:

VaspRelaxUpdater

update_relax_settings = None#
clear_relax_settings() aiida_vasp.common.builder_updater.VaspRelaxUpdater[source]#

Reset any existing relax options to defaults.

Returns:

Self for method chaining

Return type:

VaspRelaxUpdater

clear() aiida_vasp.common.builder_updater.VaspRelaxUpdater[source]#

Clear all settings including relax-specific settings.

Returns:

Self for method chaining

Return type:

VaspRelaxUpdater

class aiida_vasp.common.builder_updater.VaspMultiStageRelaxUpdater(preset_name: str | None = None, builder: aiida.engine.processes.builder.ProcessBuilder | None = None, override_vasp_namespace: aiida.engine.processes.builder.ProcessBuilderNamespace | None = None, namespace_relax: aiida.engine.processes.builder.ProcessBuilderNamespace | None = None, code: str | None = None)[source]#

Bases: aiida_vasp.common.builder_updater.VaspRelaxUpdater

An updater for VaspRelaxWorkChain

Initialization

Initialise the update object.

Parameters:
  • builder – The ProcessBuilder or ProcessBuilderNamespace to be used for setting standard VaspWorkChain inputs.

  • root_namespace – The namespace to be assumed to be the root, e.g. where the input structure should be specified. The v2 series of workchain in aiida-vasp usually has the StructureData input port at the top level interface, although there are a few exceptions.

  • preset_name – The name of the Preset to be used for the updater.

  • code – The code to be used for the calculation. If not specified, the default code from the preset will be used.

  • verbose – If True, print additional information during the update.

  • set_name – The name of the input set to be used. If not specified, the default input set from the preset will be used.

returns: An instance of VaspBuilderUpdater with the specified preset and builder.

WF_ENTRYPOINT = 'vasp.v2.staged_relax'#
class aiida_vasp.common.builder_updater.VaspConvUpdater(preset_name=None, builder=None, root_namespace=None, code=None, verbose=False, inputset_name=None)[source]#

Bases: aiida_vasp.common.builder_updater.VaspBuilderUpdater

Update for VaspConvergenceWorkChain

Initialization

Initialise the update object.

Parameters:
  • builder – The ProcessBuilder or ProcessBuilderNamespace to be used for setting standard VaspWorkChain inputs.

  • root_namespace – The namespace to be assumed to be the root, e.g. where the input structure should be specified. The v2 series of workchain in aiida-vasp usually has the StructureData input port at the top level interface, although there are a few exceptions.

  • preset_name – The name of the Preset to be used for the updater.

  • code – The code to be used for the calculation. If not specified, the default code from the preset will be used.

  • verbose – If True, print additional information during the update.

  • set_name – The name of the input set to be used. If not specified, the default input set from the preset will be used.

returns: An instance of VaspBuilderUpdater with the specified preset and builder.

WF_ENTRYPOINT = 'vasp.v2.converge'#
apply_preset(initial_structure: aiida.orm.StructureData, code: str | None = None, label: str | None = None, **kwargs: Any) aiida_vasp.common.builder_updater.VaspBuilderUpdater[source]#
set_conv_settings(**kwargs: Any) aiida_vasp.common.builder_updater.VaspConvUpdater[source]#

Set the convergence testing settings.

Parameters:

kwargs – Convergence option key-value pairs

Returns:

Self for method chaining

Return type:

VaspConvUpdater

class aiida_vasp.common.builder_updater.VaspBandUpdater(preset_name: str | None = None, builder: aiida.engine.processes.builder.ProcessBuilder | None = None, override_vasp_namespace: aiida.engine.processes.builder.ProcessBuilderNamespace | None = None, code: str | None = None)[source]#

Bases: aiida_vasp.common.builder_updater.VaspBuilderUpdater

Updater for VaspBandsWorkChain

Initialization

Initialise the update object.

Parameters:
  • builder – The ProcessBuilder or ProcessBuilderNamespace to be used for setting standard VaspWorkChain inputs.

  • root_namespace – The namespace to be assumed to be the root, e.g. where the input structure should be specified. The v2 series of workchain in aiida-vasp usually has the StructureData input port at the top level interface, although there are a few exceptions.

  • preset_name – The name of the Preset to be used for the updater.

  • code – The code to be used for the calculation. If not specified, the default code from the preset will be used.

  • verbose – If True, print additional information during the update.

  • set_name – The name of the input set to be used. If not specified, the default input set from the preset will be used.

returns: An instance of VaspBuilderUpdater with the specified preset and builder.

WF_ENTRYPOINT = 'vasp.v2.bands'#
get_relax_updater() aiida_vasp.common.builder_updater.VaspRelaxUpdater[source]#

Return the relax updater for this band structure calculation.

The relax updater can be used to populate the .relax namespace which will trigger the relaxation of the structure before band structure calculation.

Returns:

VaspRelaxUpdater instance configured for this band calculation

Return type:

VaspRelaxUpdater

apply_preset(structure: aiida.orm.StructureData, run_relax: bool = False, label: str | None = None, **kwargs: Any) aiida_vasp.common.builder_updater.VaspBandUpdater[source]#
set_band_settings(**kwargs: Any) aiida_vasp.common.builder_updater.VaspBandUpdater[source]#

Set band structure calculation specific settings.

Parameters:

kwargs – Band calculation option key-value pairs

Returns:

Self for method chaining

Return type:

VaspBandUpdater

class aiida_vasp.common.builder_updater.VaspHybridBandUpdater(preset_name: str | None = None, builder: aiida.engine.processes.builder.ProcessBuilder | None = None, override_vasp_namespace: aiida.engine.processes.builder.ProcessBuilderNamespace | None = None, code: str | None = None)[source]#

Bases: aiida_vasp.common.builder_updater.VaspBandUpdater

Updater for VaspHybridBandsWorkChain

Initialization

Initialise the update object.

Parameters:
  • builder – The ProcessBuilder or ProcessBuilderNamespace to be used for setting standard VaspWorkChain inputs.

  • root_namespace – The namespace to be assumed to be the root, e.g. where the input structure should be specified. The v2 series of workchain in aiida-vasp usually has the StructureData input port at the top level interface, although there are a few exceptions.

  • preset_name – The name of the Preset to be used for the updater.

  • code – The code to be used for the calculation. If not specified, the default code from the preset will be used.

  • verbose – If True, print additional information during the update.

  • set_name – The name of the input set to be used. If not specified, the default input set from the preset will be used.

returns: An instance of VaspBuilderUpdater with the specified preset and builder.

WF_ENTRYPOINT = 'vasp.v2.hybrid_bands'#
aiida_vasp.common.builder_updater.is_specified(port_namespace: aiida.engine.processes.builder.ProcessBuilderNamespace) bool[source]#

Check if there is anything specified under a PortNamespace.

Parameters:

port_namespace (ProcessBuilderNamespace) – Namespace to check for specified values

Returns:

True if any values are specified in the namespace

Return type:

bool

aiida_vasp.common.builder_updater.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:
  • node (orm.Dict) – The Dict node to update

  • content (dict) – Dictionary content to merge into the node

  • namespace (str or None) – Optional namespace key within the Dict to update

  • reuse_if_possible (bool) – Whether to reuse the existing node if content is unchanged

Returns:

Updated Dict node (may be the same or a new node)

Return type:

orm.Dict

aiida_vasp.common.builder_updater.builder_to_dict(builder: aiida.engine.processes.builder.ProcessBuilder, unpack: bool = True) dict[str, Any][source]#

Convert a builder to a dictionary and optionally unpack certain nodes.

When unpacked, the resulting dictionary cannot be used for submit/run. The primary usage of the resulting dictionary is for pretty printing.

Parameters:
  • builder (ProcessBuilder) – Process builder to convert

  • unpack (bool) – Whether to unpack Dict/List nodes to Python objects

Returns:

Dictionary representation of the builder

Return type:

dict

aiida_vasp.common.builder_updater.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.

Parameters:

incar_in (dict) – Input dictionary containing INCAR parameters

Returns:

Tuple of (updated_incar_dict, relax_settings_dict)

Return type:

tuple