Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PwBaseWorkChain: deprecate the pseudo_family input #603

Merged
merged 1 commit into from
Oct 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions aiida_quantumespresso/utils/pseudopotential.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# -*- coding: utf-8 -*-
"""Utilities for pseudo potentials."""
import warnings
from aiida.common.warnings import AiidaDeprecationWarning
from aiida.orm.nodes.data.upf import UpfData, get_pseudos_from_structure


Expand All @@ -26,6 +28,8 @@ def validate_and_prepare_pseudos_inputs(structure, pseudos=None, pseudo_family=N
"""
from aiida.orm import Str

warnings.warn('this function is deprecated and will be removed in `v4.0.0`.', AiidaDeprecationWarning)

if pseudos and pseudo_family:
raise ValueError('you cannot specify both "pseudos" and "pseudo_family"')
elif pseudos is None and pseudo_family is None:
Expand Down Expand Up @@ -55,6 +59,8 @@ def get_pseudos_of_calc(calc):
"""
from aiida.common.links import LinkType

warnings.warn('this function is deprecated and will be removed in `v4.0.0`.', AiidaDeprecationWarning)

pseudos = {}
# I create here a dictionary that associates each kind name to a pseudo
inputs = calc.get_incoming(link_type=LinkType.INPUT_CALC)
Expand Down Expand Up @@ -89,6 +95,8 @@ def get_pseudos_from_dict(structure, pseudos_uuids):
from aiida.common import NotExistent
from aiida.orm import load_node

warnings.warn('this function is deprecated and will be removed in `v4.0.0`.', AiidaDeprecationWarning)

pseudo_list = {}
for kind in structure.kinds:
symbol = kind.symbol
Expand Down
16 changes: 12 additions & 4 deletions aiida_quantumespresso/workflows/pw/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@
PwCalculation = CalculationFactory('quantumespresso.pw')


def validate_pseudo_family(value, _):
"""Validate the `pseudo_family` input."""
if value is not None:
import warnings
from aiida.common.warnings import AiidaDeprecationWarning
warnings.warn('`pseudo_family` is deprecated, use `pw.pseudos` instead.', AiidaDeprecationWarning)


class PwBaseWorkChain(BaseRestartWorkChain):
"""Workchain to run a Quantum ESPRESSO pw.x calculation with automated error handling and restarts."""

Expand Down Expand Up @@ -48,10 +56,10 @@ def define(cls, spec):
help='Optional input when constructing the k-points based on a desired `kpoints_distance`. Setting this to '
'`True` will force the k-point mesh to have an even number of points along each lattice vector except '
'for any non-periodic directions.')
spec.input('pseudo_family', valid_type=orm.Str, required=False,
help='An alternative to specifying the pseudo potentials manually in `pseudos`: one can specify the name '
'of an existing pseudo potential family and the work chain will generate the pseudos automatically '
'based on the input structure.')
spec.input('pseudo_family', valid_type=orm.Str, required=False, validator=validate_pseudo_family,
help='[Deprecated: use `pw.pseudos` instead] An alternative to specifying the pseudo potentials manually in'
' `pseudos`: one can specify the name of an existing pseudo potential family and the work chain will '
'generate the pseudos automatically based on the input structure.')
spec.input('automatic_parallelization', valid_type=orm.Dict, required=False,
help='When defined, the work chain will first launch an initialization calculation to determine the '
'dimensions of the problem, and based on this it will try to set optimal parallelization flags.')
Expand Down