#!/usr/bin/env amspython import argparse import os from scm.params import ParAMSJob def parse_args() -> argparse.Namespace: parser = argparse.ArgumentParser() parser.add_argument( "--no-plot", action="store_true", help="Disable displaying the correlation plot of predicted vs. reference energies.", ) return parser.parse_args() def main() -> None: args = parse_args() examples_dir = os.path.expandvars("$AMSHOME/scripting/scm/params/examples/benchmark") job = ParAMSJob.from_yaml(examples_dir) job.settings.input.Task = "SinglePoint" job.run() res = job.results.get_data_set_evaluator().results["energy"] print(res.detailed_string()) print("---------") print("Mean absolute error: {:.2f} {}".format(res.mae, res.unit)) if not args.no_plot: import matplotlib.pyplot as plt job.results.plot_simple_correlation("energy", training_set=True, validation_set=False) plt.show() if __name__ == "__main__": main()