diff --git a/wfl/cli/cli.py b/wfl/cli/cli.py index 231760e0..4508a406 100644 --- a/wfl/cli/cli.py +++ b/wfl/cli/cli.py @@ -7,8 +7,7 @@ @click.option("--verbose", "-v", is_flag=True) @click.pass_context def cli(ctx, verbose): - """Workflow command line interface. - """ + """Workflow command line interface.""" ctx.ensure_object(dict) ctx.obj["verbose"] = verbose @@ -23,6 +22,7 @@ def cli(ctx, verbose): @cli.group("generate") @click.pass_context def subcli_generate(ctx): + """Generate structures""" pass from wfl.cli.commands.generate import smiles, buildcell @@ -33,31 +33,37 @@ def subcli_generate(ctx): @cli.group("select") @click.pass_context def subcli_select(ctx): + """Select structures from database""" pass from wfl.cli.commands.select import cur, by_lambda subcli_select.add_command(cur) subcli_select.add_command(by_lambda) - -@cli.group("eval") +@cli.group("calculator") @click.pass_context -def subcli_eval(ctx): +def subcli_calc(ctx): + """Calculate properties""" pass -from wfl.cli.commands.eval import gap, ace, mace, atomization_energy -subcli_eval.add_command(gap) -subcli_eval.add_command(ace) -subcli_eval.add_command(mace) -subcli_eval.add_command(atomization_energy) +from wfl.cli.commands.calc import gap, ace, mace, atomization_energy + +subcli_calc.add_command(gap) +subcli_calc.add_command(ace) +subcli_calc.add_command(mace) +subcli_calc.add_command(atomization_energy) @cli.group("descriptor") @click.pass_context def subcli_descriptor(ctx): + """Calculate descriptors""" pass -from wfl.cli.commands.descriptor import quippy +from wfl.cli.commands.descriptor import quippy subcli_descriptor.add_command(quippy) + + + diff --git a/wfl/cli/commands/eval.py b/wfl/cli/commands/calc.py similarity index 92% rename from wfl/cli/commands/eval.py rename to wfl/cli/commands/calc.py index d5e93bb7..242520dc 100644 --- a/wfl/cli/commands/eval.py +++ b/wfl/cli/commands/calc.py @@ -6,6 +6,7 @@ from wfl.cli import cli_options as opt from wfl.calculators import generic from wfl.utils import configs +import wfl.descriptors.quippy @click.command("gap") @@ -16,7 +17,7 @@ @opt.prop_prefix @opt.num_inputs_per_python_subprocess def gap(ctx, inputs, outputs, param_fname, prop_prefix, num_inputs_per_python_subprocess): - """evaluates GAP""" + """evaluate GAP""" if prop_prefix is None: prop_prefix="gap_" @@ -44,7 +45,7 @@ def pyjulip_ace(param_fname): @opt.prop_prefix @opt.num_inputs_per_python_subprocess def ace(ctx, inputs, outputs, param_fname, prop_prefix, num_inputs_per_python_subprocess): - """evaluates ACE""" + """evaluate ACE""" if prop_prefix is None: prop_prefix = 'ace_' @@ -68,7 +69,7 @@ def ace(ctx, inputs, outputs, param_fname, prop_prefix, num_inputs_per_python_su @opt.prop_prefix @opt.num_inputs_per_python_subprocess def mace(ctx, inputs, outputs, param_fname, prop_prefix, num_inputs_per_python_subprocess, dtype): - """evaluates MACE""" + """evaluate MACE""" from mace.calculators.mace import MACECalculator @@ -93,7 +94,8 @@ def mace(ctx, inputs, outputs, param_fname, prop_prefix, num_inputs_per_python_s help="``atoms.info`` key on which to select isolated atoms") @click.option("--isolated-atom-info-value", "-v", default="default", help="``atoms.info['isolated_atom_info_key']`` value for isolated atoms. Defaults to \"IsolatedAtom\" or \"isolated_atom\"") -def atomization_energy(inputs, outputs, prop_prefix, prop, isolated_atom_info_key, isolated_atom_info_value): +def atomization_energy(ctx, inputs, outputs, prop_prefix, prop, isolated_atom_info_key, isolated_atom_info_value): + """Calculate atomization energy""" configs.atomization_energy( inputs=inputs, outputs=outputs, diff --git a/wfl/cli/commands/descriptor.py b/wfl/cli/commands/descriptor.py index 65de7dc6..f5a88f5e 100644 --- a/wfl/cli/commands/descriptor.py +++ b/wfl/cli/commands/descriptor.py @@ -6,14 +6,12 @@ @click.pass_context @click.option("--local", is_flag=True, help="calculate a local (per-atom) descriptor") @click.option("--force", is_flag=True, help="overwrite existing info or arrays item if present") -@click.option("--descriptor", type=click.STRING, required=True, help="quippy.descriptors.Descriptor arg string") +@click.option("--descriptor", type=click.STRING, required=True, help="quippy.Descriptor arg string") @click.option("--key", required=True, type=click.STRING, help="Atoms.info (global) or Atoms.arrays (local) for descriptor vector") @opt.inputs @opt.outputs def quippy(ctx, inputs, outputs, descriptor, key, local, force): - calculate_descriptor(inputs, outputs, descriptor, key, local, force) - -def calculate_descriptor(inputs, outputs, descriptor, key, local, force): + """Calculate quippy descriptors""" wfl.descriptors.quippy.calc( inputs=inputs, outputs=outputs, diff --git a/wfl/cli/commands/error.py b/wfl/cli/commands/error.py index 22211065..3a1fba17 100644 --- a/wfl/cli/commands/error.py +++ b/wfl/cli/commands/error.py @@ -37,7 +37,7 @@ def show_error(ctx, inputs, calc_property_prefix, ref_property_prefix, config_properties, atom_properties, category_keys, weight_property, precision, fig_name, error_type, cmap): - """Prints error summary table""" + """Print error summary table and plot parity plot""" # TODO # - clean up cmap diff --git a/wfl/cli/commands/select.py b/wfl/cli/commands/select.py index 68ff7132..900caba9 100644 --- a/wfl/cli/commands/select.py +++ b/wfl/cli/commands/select.py @@ -38,7 +38,7 @@ def cur(ctx, inputs, outputs, n_configs, key, keep_descriptor, @opt.inputs @opt.outputs def by_lambda(ctx, inputs, outputs, exec_code): - """selects atoms based on a lambda function""" + """Select atoms based on a lambda function""" at_filter_fun = eval("lambda atoms: " + exec_code)