Skip to content

Do not rely on kpoints validation from aiida-quantumespresso #8

@greschd

Description

@greschd

The code below relies on the PwBaseWorkChain input validation to catch that either kpoints or kpoint_distance needs to be set:

try:
inputs.kpoints
except AttributeError:
# then kpoints_distance must exists, since this is ensured by inputs check of this workchain
from aiida_quantumespresso.workflows.functions.create_kpoints_from_distance import create_kpoints_from_distance
force_parity = inputs.get('kpoints_force_parity', orm.Bool(False))
kmesh = create_kpoints_from_distance(
self.ctx.current_structure, inputs.kpoints_distance,
force_parity
)

However (maybe since a recent release?) aiida-quantumespresso doesn't do that, instead the k-points are checked after the workchain has started, and an error code is returned if they are invalid.

This means that this workchain will except when both kpoints and kpoint_distance or not set, instead of giving a "well-behaved" error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions