Example #1
0
)

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.'
)

RELAX_TYPE = options.OverridableOption(
    '-r',
    '--relax-type',
    type=types.LazyChoice(get_relax_types),
    default='atoms',
    show_default=True,
    callback=lambda ctx, param, value: RelaxType(value),
    help='Select the relax type with which the workflow should be run.')

SPIN_TYPE = options.OverridableOption(
    '-s',
    '--spin-type',
    type=types.LazyChoice(get_spin_types),
    default='none',
    show_default=True,
    callback=lambda ctx, param, value: SpinType(value),
    help='Select the spin type with which the workflow should be run.')

THRESHOLD_FORCES = options.OverridableOption(
Example #2
0
@click.option(
    '-u',
    '--user',
    'user_email',
    type=click.STRING,
    help='Add a filter to show only groups belonging to a specific user')
@click.option('-a',
              '--all-types',
              is_flag=True,
              default=False,
              help='Show groups of all types')
@click.option(
    '-t',
    '--type',
    'group_type',
    type=types.LazyChoice(valid_group_type_strings),
    default=user_defined_group,
    help=
    'Show groups of a specific type, instead of user-defined groups. Start with semicolumn if you want to '
    'specify aiida-internal type')
@click.option('-d',
              '--with-description',
              'with_description',
              is_flag=True,
              default=False,
              help='Show also the group description')
@click.option('-C',
              '--count',
              is_flag=True,
              default=False,
              help='Show also the number of nodes in the group')
Example #3
0
from aiida.cmdline.params import arguments
from aiida.cmdline.params import types

from aiida_common_workflows.plugins import get_workflow_entry_point_names, load_workflow_entry_point
from .root import cmd_root
from . import options
from . import utils


@cmd_root.group('launch')
def cmd_launch():
    """Launch a common workflow."""


@cmd_launch.command('relax')
@click.argument('plugin', type=types.LazyChoice(functools.partial(get_workflow_entry_point_names, 'relax', True)))
@options.STRUCTURE(help='The structure to relax.')
@options.PROTOCOL(type=click.Choice(['fast', 'moderate', 'precise']), default='fast')
@options.RELAXATION_TYPE()
@options.THRESHOLD_FORCES()
@options.THRESHOLD_STRESS()
@options.NUMBER_MACHINES()
@options.WALLCLOCK_SECONDS()
@options.DAEMON()
@click.option('--show-engines', is_flag=True, help='Show information on the required calculation engines.')
def cmd_relax(
    plugin, structure, protocol, relaxation_type, threshold_forces, threshold_stress, number_machines,
    wallclock_seconds, daemon, show_engines
):
    """Relax a crystal structure using the common relax workflow for one of the existing plugin implementations.
Example #4
0
from aiida.cmdline.params import types
from aiida_common_workflows.plugins import get_workflow_entry_point_names, load_workflow_entry_point
from .root import cmd_root
from . import options
from . import utils


@cmd_root.group('launch')
def cmd_launch():
    """Launch a common workflow."""


@cmd_launch.command('relax')
@click.argument('plugin',
                type=types.LazyChoice(
                    functools.partial(get_workflow_entry_point_names, 'relax',
                                      True)))
@options.STRUCTURE()
@options.CODES()
@options.PROTOCOL(type=click.Choice(['fast', 'moderate', 'precise']),
                  default='fast')
@options.RELAX_TYPE()
@options.SPIN_TYPE()
@options.THRESHOLD_FORCES()
@options.THRESHOLD_STRESS()
@options.NUMBER_MACHINES()
@options.WALLCLOCK_SECONDS()
@options.DAEMON()
@options.MAGNETIZATION_PER_SITE()
@options.PREVIOUS_WORKCHAIN()
@click.option('--show-engines',
Example #5
0
    type=click.STRING, metavar='LABEL',
    help='Short name to be used as a label.')

DESCRIPTION = OverridableOption(
    '-D', '--description',
    type=click.STRING, metavar='DESCRIPTION', default='', required=False,
    help='A detailed description.')

INPUT_PLUGIN = OverridableOption(
    '-P', '--input-plugin',
    type=types.PluginParamType(group='calculations'),
    help='Calculation input plugin string.')

CALCULATION_STATE = OverridableOption(
    '-s', '--calculation-state', 'calculation_state',
    type=types.LazyChoice(valid_calculation_states), cls=MultipleValueOption,
    help='Only include entries with this calculation state.')

PROCESS_STATE = OverridableOption(
    '-S', '--process-state', 'process_state',
    type=types.LazyChoice(valid_process_states), cls=MultipleValueOption, default=active_process_states,
    help='Only include entries with this process state.')

EXIT_STATUS = OverridableOption(
    '-E', '--exit-status', 'exit_status',
    type=click.INT,
    help='Only include entries with this exit status.')

FAILED = OverridableOption(
    '-X', '--failed', 'failed',
    is_flag=True, default=False,