obr.cli#

Module that contains the command line app.

Why does this file exist, and why not put this in __main__?

You might be tempted to import things from __main__ later, but that will cause problems: the code will get executed twice:

  • When you run python -mobr python will execute __main__.py as a script. That means there won’t be any obr.__main__ in sys.modules.

  • When you import __main__ it will get executed again (as a module) because there’s no obr.__main__ in sys.modules.

Also see (1) from http://click.pocoo.org/5/setuptools/#setuptools-integration

Module Contents#

Functions#

common_params(func)

check_cli_operations(→ bool)

list available operations if none are specified or given the click option or an incorrect op is given

is_valid_workspace(→ bool)

This function checks if:

cli_cmd_setup(...)

This function performs the common pattern of checking project folders for existence and creating the project and extracting the jobs.

copy_to_archive(→ None)

Copies files to archive repo

cli(ctx, **kwargs)

submit(ctx, **kwargs)

run(ctx, **kwargs)

Run specified operations

init(ctx, **kwargs)

status(ctx, **kwargs)

query(ctx, **kwargs)

apply(ctx, **kwargs)

reset(ctx, **kwargs)

deletes workspace or cases

archive(ctx, **kwargs)

main()

obr.cli.common_params(func)#
obr.cli.check_cli_operations(project: obr.signac_wrapper.operations.OpenFOAMProject, operations: list[str], list_operations: Any | None) bool#

list available operations if none are specified or given the click option or an incorrect op is given

obr.cli.is_valid_workspace(filters: list = []) bool#

This function checks if: - the workspace folder is not empty, and - applying filters would return an empty list

obr.cli.cli_cmd_setup(kwargs: dict) tuple[obr.signac_wrapper.operations.OpenFOAMProject, signac.job.Job]#

This function performs the common pattern of checking project folders for existence and creating the project and extracting the jobs.

obr.cli.copy_to_archive(repo: git.repo.Repo | None, use_git_repo: bool, src_file: pathlib.Path, target_file: pathlib.Path) None#

Copies files to archive repo

obr.cli.cli(ctx: click.Context, **kwargs)#
obr.cli.submit(ctx: click.Context, **kwargs)#
obr.cli.run(ctx: click.Context, **kwargs)#

Run specified operations

obr.cli.init(ctx: click.Context, **kwargs)#
obr.cli.status(ctx: click.Context, **kwargs)#
obr.cli.query(ctx: click.Context, **kwargs)#
obr.cli.apply(ctx: click.Context, **kwargs)#
obr.cli.reset(ctx: click.Context, **kwargs)#

deletes workspace or cases

obr.cli.archive(ctx: click.Context, **kwargs)#
obr.cli.main()#