Skip to content
Snippets Groups Projects
Commit 648a2e68 authored by Yngve Levinsen's avatar Yngve Levinsen
Browse files

use f-string

parent c59f2ee1
No related branches found
No related tags found
No related merge requests found
Pipeline #31149 passed
...@@ -52,20 +52,20 @@ if not os.path.isfile(args.project): ...@@ -52,20 +52,20 @@ if not os.path.isfile(args.project):
raise ValueError("Project file does not exist") raise ValueError("Project file does not exist")
if args.lattice: if args.lattice:
cmd.append("dat_file=" + args.lattice) cmd.append(f"dat_file={args.lattice}")
for arg in ["dst_file1", "dst_file2", "current1", "current2", "nbr_part1", "nbr_part2", "energy1", "energy2", "freq1", "freq2"]: for arg in ["dst_file1", "dst_file2", "current1", "current2", "nbr_part1", "nbr_part2", "energy1", "energy2", "freq1", "freq2"]:
attr = getattr(args, arg) attr = getattr(args, arg)
if attr: if attr:
cmd.append(arg + "=" + attr) cmd.append(f"{arg}={attr}")
if args.outpath: if args.outpath:
if not os.path.isdir(args.outpath): if not os.path.isdir(args.outpath):
print("WARNING: output directory does not exist, creating..") print("WARNING: output directory does not exist, creating..")
os.makedirs(args.outpath) os.makedirs(args.outpath)
cmd.append("path_cal='" + os.path.abspath(args.outpath) + "'") cmd.append(f"path_cal='{os.path.abspath(args.outpath)}'")
if args.seed: if args.seed:
cmd.append("random_seed=" + str(args.seed)) cmd.append(f"random_seed={args.seed}")
print(" ".join(cmd)) print(" ".join(cmd))
if args.run: if args.run:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment