# ruff: noqa: I002, FA100"""Set up commandline interface."""# Issues with future annotations and typer# c.f. https://github.com/maxb2/typer-config/issues/295# from __future__ import annotationsfromtypingimportAnnotatedfromtyperimportExit,Option,Typerfromjanus_coreimport__version__fromjanus_core.cli.descriptorsimportdescriptorsfromjanus_core.cli.eosimporteosfromjanus_core.cli.geomoptimportgeomoptfromjanus_core.cli.mdimportmdfromjanus_core.cli.phononsimportphononsfromjanus_core.cli.preprocessimportpreprocessfromjanus_core.cli.singlepointimportsinglepointfromjanus_core.cli.trainimporttrainapp=Typer(name="janus",no_args_is_help=True)app.command(help="Perform single point calculations and save to file.")(singlepoint)app.command(help="Perform geometry optimization and save optimized structure to file.")(geomopt)app.command(help="Run molecular dynamics simulation, and save trajectory and statistics.")(md)app.command(help="Calculate phonons and save results.")(phonons)app.command(help="Calculate equation of state.")(eos)app.command(help="Calculate MLIP descriptors.")(descriptors)app.command(help="Running training for an MLIP.")(train)app.command(help="Running preprocessing for an MLIP.")(preprocess)
[docs]@app.callback(invoke_without_command=True,help="")defprint_version(version:Annotated[bool,Option("--version",help="Print janus version and exit.")]=None,)->False:""" Print current janus-core version and exit. Parameters ---------- version : bool Whether to print the current janus-core version. """ifversion:print(f"janus-core version: {__version__}")raiseExit()