"""Set up commandline interface."""from__future__importannotationsfromtypingimportAnnotatedfromtyperimportExit,Option,Typerfromjanus_coreimport__version__fromjanus_core.cli.descriptorsimportdescriptorsfromjanus_core.cli.eosimporteosfromjanus_core.cli.geomoptimportgeomoptfromjanus_core.cli.mdimportmdfromjanus_core.cli.nebimportnebfromjanus_core.cli.phononsimportphononsfromjanus_core.cli.preprocessimportpreprocessfromjanus_core.cli.singlepointimportsinglepointfromjanus_core.cli.trainimporttrainapp=Typer(name="janus",no_args_is_help=True,epilog="Try 'janus COMMAND --help' for subcommand options",)app.command(help="Perform single point calculations and save to file.",rich_help_panel="Calculations",)(singlepoint)app.command(help="Perform geometry optimization and save optimized structure to file.",rich_help_panel="Calculations",)(geomopt)app.command(help="Run molecular dynamics simulation, and save trajectory and statistics.",rich_help_panel="Calculations",)(md)app.command(help="Calculate phonons and save results.",rich_help_panel="Calculations",)(phonons)app.command(help="Calculate equation of state.",rich_help_panel="Calculations",)(eos)app.command(help="Run Nudged Elastic Band method.",rich_help_panel="Calculations",)(neb)app.command(help="Calculate MLIP descriptors.",rich_help_panel="Calculations",)(descriptors)app.command(help="Train or fine-tune an MLIP.",rich_help_panel="Training",)(train)app.command(help="Preprocess data before training.",rich_help_panel="Training",)(preprocess)
[docs]@app.callback(invoke_without_command=True,help="")defprint_version(version:Annotated[bool,Option("--version",help="Print janus version and exit.")]=None,)->None:""" Print current janus-core version and exit. Parameters ---------- version Whether to print the current janus-core version. """ifversion:print(f"janus-core version: {__version__}")raiseExit()