Skip to content

Commit

Permalink
devel (#12)
Browse files Browse the repository at this point in the history
• work in progress: automatic supporting information (SI) generation (with bib entries)
• new printout showing the number of conformers within an energy window
• symmetry number correction (for part1) because of (DFT) unoptimized geometries
• the configuration file location information is saved and automatically reloaded on restart
• printing command line argument call at program startup
• experimental “read only” feature to fill the enso.json information by only reading the output of previous calculations (the program input arguments have to be exactly the same!)
• fixed NMR shielding constant calculations and MORead
• NMR new printout of min and max calculated shielding constants per investigated nuclei
• OR new printout of min and max OR value and corresponding conformers
• fixed balance option and wrong xtb call
• improved restarting of optical rotation calculations
• tutorial option has details on solvents and naming within CENSO, and information on functionals for OR is updated
• improved optimization routine
  • Loading branch information
fabothch authored Apr 12, 2021
1 parent 486f77d commit d2b0abf
Show file tree
Hide file tree
Showing 20 changed files with 2,646 additions and 1,523 deletions.
2 changes: 1 addition & 1 deletion censo_qm/adf_job.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# adf_job.py

# for J and S calculation only
# for J and S calculation only
74 changes: 43 additions & 31 deletions censo_qm/censo.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def main(argv=None):
sys.exit(1)
toc = perf_counter()
ensembledata.part_info["part0"] = toc - tic
ensembledata.previous_part_info["part0"] += ensembledata.part_info["part0"]
ensembledata.previous_part_info["part0"] += ensembledata.part_info["part0"]
print(f"Ran part0 in {ensembledata.part_info['part0']:0.4f} seconds")

# RUNNING PART1
Expand All @@ -87,7 +87,9 @@ def main(argv=None):
toc = perf_counter()
ensembledata.part_info["part1"] = toc - tic
ensembledata.previous_part_info["part1"] += ensembledata.part_info["part1"]
ensembledata.previous_part_info["part1_firstsort"] += ensembledata.part_info["part1_firstsort"]
ensembledata.previous_part_info["part1_firstsort"] += ensembledata.part_info[
"part1_firstsort"
]
print(f"Ran part1 in {ensembledata.part_info['part1']:0.4f} seconds")

# RUNNING PART2
Expand All @@ -112,7 +114,9 @@ def main(argv=None):
toc = perf_counter()
ensembledata.part_info["part2"] = toc - tic
ensembledata.previous_part_info["part2"] += ensembledata.part_info["part2"]
ensembledata.previous_part_info["part2_opt"] += ensembledata.part_info["part2_opt"]
ensembledata.previous_part_info["part2_opt"] += ensembledata.part_info[
"part2_opt"
]
print(f"Ran part2 in {ensembledata.part_info['part2']:0.4f} seconds")

# RUNNING PART3
Expand Down Expand Up @@ -196,6 +200,9 @@ def main(argv=None):
config.provide_runinfo(),
)

if args.create_si:
config.create_SI(ensembledata)

# END of CENSO
timings = 0.0
prev_timings = 0.0
Expand All @@ -208,44 +215,47 @@ def main(argv=None):
tmp = []
tmp_prev = []
if config.part0:
tmp.append(ensembledata.part_info['part0'])
tmp_prev.append(ensembledata.previous_part_info['part0'])
tmp.append(ensembledata.part_info["part0"])
tmp_prev.append(ensembledata.previous_part_info["part0"])
if config.part1:
tmp.append(ensembledata.part_info['part1'])
tmp_prev.append(ensembledata.previous_part_info['part1'])
tmp_prev.append(ensembledata.previous_part_info['part1_firstsort'])
tmp.append(ensembledata.part_info["part1"])
tmp_prev.append(ensembledata.previous_part_info["part1"])
tmp_prev.append(ensembledata.previous_part_info["part1_firstsort"])
if config.part2:
tmp.append(ensembledata.part_info['part2'])
tmp_prev.append(ensembledata.previous_part_info['part2'])
tmp.append(ensembledata.part_info['part2_opt'])
tmp_prev.append(ensembledata.previous_part_info['part2_opt'])
tmp.append(ensembledata.part_info["part2"])
tmp_prev.append(ensembledata.previous_part_info["part2"])
tmp.append(ensembledata.part_info["part2_opt"])
tmp_prev.append(ensembledata.previous_part_info["part2_opt"])
if config.part3:
tmp.append(ensembledata.part_info['part3'])
tmp_prev.append(ensembledata.previous_part_info['part3'])
tmp.append(ensembledata.part_info["part3"])
tmp_prev.append(ensembledata.previous_part_info["part3"])
if config.part4:
tmp.append(ensembledata.part_info['part4'])
tmp_prev.append(ensembledata.previous_part_info['part4'])
tmp.append(ensembledata.part_info["part4"])
tmp_prev.append(ensembledata.previous_part_info["part4"])
if config.optical_rotation:
tmp.append(ensembledata.part_info['part5'])
tmp_prev.append(ensembledata.previous_part_info['part5'])
timelen = max([len(f"{float(value):.2f}") for value in tmp]) +2
prev_timelen = max([len(f"{float(value):.2f}") for value in tmp_prev]) +2
tmp.append(ensembledata.part_info["part5"])
tmp_prev.append(ensembledata.previous_part_info["part5"])
timelen = max([len(f"{float(value):.2f}") for value in tmp]) + 2
prev_timelen = max([len(f"{float(value):.2f}") for value in tmp_prev]) + 2
if timelen < 7:
timelen = 7
except Exception:
timelen = 20
prev_timelen = 20


print(f"\n\n{'Part':20}: {'#conf':>{conflength}} {'time': >{timelen}} time (including restarts)")
print("".ljust(int(PLENGTH/1.4), "-"))
print(f"{'Input':20}: {ensembledata.nconfs_per_part['starting']:{conflength}} {'-':^{timelen+2}} {'-':^{timelen+2}}")
print(
f"\n\n{'Part':20}: {'#conf':>{conflength}} {'time': >{timelen}} time (including restarts)"
)
print("".ljust(int(PLENGTH / 1.4), "-"))
print(
f"{'Input':20}: {ensembledata.nconfs_per_part['starting']:{conflength}} {'-':^{timelen+2}} {'-':^{timelen+2}}"
)
if config.part0:
print(
f"{'Part0_all':20}: {ensembledata.nconfs_per_part['part0']:{conflength}} {ensembledata.part_info['part0']:{timelen}.2f} s {ensembledata.previous_part_info['part0']:>{prev_timelen}.2f} s"
)
timings += ensembledata.part_info["part0"]
prev_timings += ensembledata.previous_part_info['part0']
prev_timings += ensembledata.previous_part_info["part0"]
if config.part1:
print(
f"{'Part1_initial_sort':20}: {ensembledata.nconfs_per_part['part1_firstsort']:{conflength}} {ensembledata.part_info['part1_firstsort']:{timelen}.2f} s {ensembledata.previous_part_info['part1_firstsort']:>{prev_timelen}.2f} s"
Expand All @@ -254,7 +264,7 @@ def main(argv=None):
f"{'Part1_all':20}: {ensembledata.nconfs_per_part['part1_firstsort']:{conflength}} {ensembledata.part_info['part1']:{timelen}.2f} s {ensembledata.previous_part_info['part1']:>{prev_timelen}.2f} s"
)
timings += ensembledata.part_info["part1"]
prev_timings += ensembledata.previous_part_info['part1']
prev_timings += ensembledata.previous_part_info["part1"]
if config.part2:
print(
f"{'Part2_opt':20}: {ensembledata.nconfs_per_part['part2_opt']:{conflength}} {ensembledata.part_info['part2_opt']:{timelen}.2f} s {ensembledata.previous_part_info['part2_opt']:>{prev_timelen}.2f} s"
Expand All @@ -263,26 +273,28 @@ def main(argv=None):
f"{'Part2_all':20}: {ensembledata.nconfs_per_part['part2']:{conflength}} {ensembledata.part_info['part2']:{timelen}.2f} s {ensembledata.previous_part_info['part2']:>{prev_timelen}.2f} s"
)
timings += ensembledata.part_info["part2"]
prev_timings += ensembledata.previous_part_info['part2']
prev_timings += ensembledata.previous_part_info["part2"]
if config.part3:
print(
f"{'Part3_all':20}: {ensembledata.nconfs_per_part['part3']:{conflength}} {ensembledata.part_info['part3']:{timelen}.2f} s {ensembledata.previous_part_info['part3']:>{prev_timelen}.2f} s"
)
timings += ensembledata.part_info["part3"]
prev_timings += ensembledata.previous_part_info['part3']
prev_timings += ensembledata.previous_part_info["part3"]
if config.part4:
print(
f"{'Part4':20}: {'':{conflength}} {ensembledata.part_info['part4']:{timelen}.2f} s {ensembledata.previous_part_info['part4']:>{prev_timelen}.2f} s"
)
timings += ensembledata.part_info["part4"]
prev_timings += ensembledata.previous_part_info['part4']
prev_timings += ensembledata.previous_part_info["part4"]
if config.optical_rotation:
print(
f"{'Part5':20}: {'':{conflength}} {ensembledata.part_info['part5']:{timelen}.2f} s {ensembledata.previous_part_info['part5']:>{prev_timelen}.2f} s"
)
timings += ensembledata.part_info["part5"]
prev_timings += ensembledata.previous_part_info['part5']
prev_timings += ensembledata.previous_part_info["part5"]
print("".ljust(int(PLENGTH / 1.4), "-"))
print(f"{'All parts':20}: {'-':>{conflength}} {timings:{timelen}.2f} s {prev_timings:{prev_timelen}.2f} s")
print(
f"{'All parts':20}: {'-':>{conflength}} {timings:{timelen}.2f} s {prev_timings:{prev_timelen}.2f} s"
)
print("\nCENSO all done!")
return 0
Loading

0 comments on commit d2b0abf

Please sign in to comment.