예제 #1
0
    config = get_config()

    for available_profile in config.profiles:
        if available_profile.database_username == username:
            value = available_profile.database_password
            break
    else:
        value = get_random_string(16)

    return value


SETUP_PROFILE = options.OverridableOption(
    '--profile',
    prompt='Profile name',
    help='The name of the new profile.',
    required=True,
    type=types.ProfileParamType(cannot_exist=True),
    cls=options.interactive.InteractiveOption)

SETUP_USER_EMAIL = options.USER_EMAIL.clone(
    prompt='Email Address (for sharing data)',
    default=get_config_option('user.email'),
    required_fn=lambda x: get_config_option('user.email') is None,
    required=True,
    cls=options.interactive.InteractiveOption)

SETUP_USER_FIRST_NAME = options.USER_FIRST_NAME.clone(
    prompt='First name',
    default=get_config_option('user.first_name'),
    required_fn=lambda x: get_config_option('user.first_name') is None,
예제 #2
0
        group, group_created = Group.objects.get_or_create(
            label=family_name, type_string=upf.UPFGROUP_TYPE)

    # Update description of the group
    group.description = "Automatic group created by the aiida-Wannier90 minimal workflow example"
    # Put the pseudos in the group
    group.add_nodes(pseudo_nodes)

    print("Created new UPF group '{}' with nodes {}".format(
        family_name, ", ".join(str(node.pk) for node in pseudo_nodes)))
    return family_name


PWCODE = options.OverridableOption(
    '-s',
    '--pwscf-code',
    required=True,
    type=types.CodeParamType(entry_point='quantumespresso.pw'),
    help="The Quantum ESPRESSO pw.x (PWscf) code")
PW2WANCODE = options.OverridableOption(
    '-p',
    '--pw2wannier90-code',
    required=True,
    type=types.CodeParamType(entry_point='quantumespresso.pw2wannier90'),
    help="The Quantum ESPRESSO pw2wannier90.x code")

WANCODE = options.OverridableOption(
    '-w',
    '--wannier-code',
    required=True,
    type=types.CodeParamType(entry_point='wannier90.wannier90'),
    help="The Wannier90 wannier90.x code")
예제 #3
0
                                              'extras._aiida_hash':
                                              structure._get_hash()
                                          }).first()  # pylint: disable=protected-access

        if duplicate:
            return duplicate[0]

        return structure


CODES = options.OverridableOption(
    '-X',
    '--codes',
    'codes',
    type=types.CodeParamType(),
    cls=options.MultipleValueOption,
    help=
    'One or multiple codes identified by their ID, UUID or label. What codes are required is dependent on the '
    'selected plugin and can be shown using the `--show-engines` option. If no explicit codes are specified, one will '
    'be loaded from the database based on the required input plugins. If multiple codes are matched, a random one will '
    'be selected.')

STRUCTURE = options.OverridableOption(
    '-S',
    '--structure',
    type=StructureDataParamType(),
    default='Si',
    help=
    'Select a structure: either choose one of the default structures listed above, or an existing `StructureData` '
    'identifier, or a file on disk with a structure definition that can be parsed by `ase`.'
)
예제 #4
0
    config = get_config()

    for available_profile in config.profiles:
        if available_profile.database_username == username:
            value = available_profile.database_password
            break
    else:
        value = get_random_string(16)

    return value


SETUP_PROFILE = options.OverridableOption(
    '--profile',
    prompt='Profile name',
    help='The name of the new profile.',
    required=True,
    type=types.ProfileParamType(cannot_exist=True),
    cls=options.interactive.InteractiveOption
)

SETUP_USER_EMAIL = options.OverridableOption(
    '--email',
    'email',
    prompt='User email',
    help='Email address that serves as the user name and a way to identify data created by it.',
    default=get_config_option('user.email'),
    required_fn=lambda x: get_config_option('user.email') is None,
    required=True,
    cls=options.interactive.InteractiveOption
)
예제 #5
0
"""Common click options for verdi commands"""
import click
from aiida.cmdline.params import options

FAMILY_NAME = options.OverridableOption('--name',
                                        required=True,
                                        help='Name of the BasisSet family')
PATH = options.OverridableOption('--path',
                                 default='.',
                                 type=click.Path(exists=True),
                                 help='Path to the folder')

DRY_RUN = options.OverridableOption(
    '--dry-run',
    is_flag=True,
    is_eager=True,
    help='do not commit to database or modify configuration files')

FORCE = options.FORCE
DESCRIPTION = options.DESCRIPTION
예제 #6
0
            spacegroup=227,
            cellpar=[alat, alat, alat, 90, 90, 90],
            primitive_cell=True,
        )
        structure = StructureData(ase=ase_structure)
        structure.store()
    else:
        structure = results[0]

    return structure.uuid


STRUCTURE = options.OverridableOption(
    '-S',
    '--structure',
    type=types.DataParamType(sub_classes=('aiida.data:structure',)),
    default=get_structure,
    help='A structure data node.'
)

PROTOCOL = options.OverridableOption(
    '-p',
    '--protocol',
    type=click.Choice(['fast', 'moderate', 'precise']),
    default='fast',
    show_default=True,
    help='Select the protocol with which the inputs for the workflow should be generated.'
)

RELAXATION_TYPE = options.OverridableOption(
    '-r',