Commit 109b23d8 authored by Niccolo.Ricardi's avatar Niccolo.Ricardi
Browse files

extras is handled properly

parent 7b8ad7c5
......@@ -377,11 +377,11 @@ def macrocycles(queue, rem_kw={}, fde_kw={}, extras="", maxiter=8, thresh=1e-8,
if extras:
if type(extras) == list:
extras = "\n".join(extras)
extras = "\n".join([extras, s_fde])
extra_sects = "\n".join([extras, s_fde])
frag_specs = dict(frag_a=frags["A"], frag_b=frags["B"])
frag_specs.update(elconf)
s_frags = Tfragments.substitute(ut.myupd(Tdefaults["molecule"], frag_specs))
specs = ut.myupd(Tdefaults["inp"], rem_kw=s_rem_kw, molecule=s_frags, extras=extras)
specs = ut.myupd(Tdefaults["inp"], rem_kw=s_rem_kw, molecule=s_frags, extras=extra_sects)
if it == 0:
if A_init:
sh.copy(os.path.join(root, "Densmat_A.txt"), path_cur)
......@@ -434,8 +434,8 @@ def macrocycles(queue, rem_kw={}, fde_kw={}, extras="", maxiter=8, thresh=1e-8,
path_B = os.path.join(root, "Densmat_B.txt")
if not A_init or not B_init:
s_fde = Tfde.substitute(Tdefaults["fde"], **fde_kw)
extras = "\n".join([extras, s_fde])
specs = ut.myupd(Tdefaults["inp"], rem_kw=s_rem_kw, molecule=s_frags, extras=extras)
extra_sects = "\n".join([extras, s_fde])
specs = ut.myupd(Tdefaults["inp"], rem_kw=s_rem_kw, molecule=s_frags, extras=extra_sects)
difference_to_last = energy[-1] - energy[-2] if it >= 2 else 1
#------------------------------------------------------------------------------
# ALL OTHER JOBS
......@@ -572,15 +572,15 @@ def freeze_and_thaw(queue, rem_kw={}, fde_kw={}, extras="", maxiter=8, thresh=1e
if extras:
if type(extras) == list:
extras = "\n".join(extras)
extras = "\n".join([extras, s_fde])
extra_sects = "\n".join([extras, s_fde])
frag_specs = dict(frag_a=frags["A"], frag_b=frags["B"])
frag_specs.update(elconf)
frag_specs_rev = dict(frag_a=frags["B"], frag_b=frags["A"])
frag_specs_rev.update(elconf_rev)
s_frags = Tfragments.substitute(ut.myupd(Tdefaults["molecule"], frag_specs))
s_frags_rev = Tfragments.substitute(ut.myupd(Tdefaults["molecule"], frag_specs_rev))
specs = ut.myupd(Tdefaults["inp"], rem_kw=s_rem_kw, molecule=s_frags, extras=extras)
specs_rev = ut.myupd(Tdefaults["inp"], rem_kw=s_rem_kw, molecule=s_frags_rev, extras=extras)
specs = ut.myupd(Tdefaults["inp"], rem_kw=s_rem_kw, molecule=s_frags, extras=extra_sects)
specs_rev = ut.myupd(Tdefaults["inp"], rem_kw=s_rem_kw, molecule=s_frags_rev, extras=extra_sects)
if it == 0:
### FIRST JOB
......@@ -658,9 +658,9 @@ def freeze_and_thaw(queue, rem_kw={}, fde_kw={}, extras="", maxiter=8, thresh=1e
copy_density(densMat_B, "Densmat_B.txt", header_src=True, alpha_only_src=True)
if not A_init or not B_init:
s_fde = Tfde.substitute(Tdefaults["fde"], **fde_kw)
extras = "\n".join([extras, s_fde])
specs = ut.myupd(Tdefaults["inp"], rem_kw=s_rem_kw, molecule=s_frags, extras=extras)
specs_rev = ut.myupd(Tdefaults["inp"], rem_kw=s_rem_kw, molecule=s_frags_rev, extras=extras)
extra_sects = "\n".join([extras, s_fde])
specs = ut.myupd(Tdefaults["inp"], rem_kw=s_rem_kw, molecule=s_frags, extras=extra_sects)
specs_rev = ut.myupd(Tdefaults["inp"], rem_kw=s_rem_kw, molecule=s_frags_rev, extras=extra_sects)
is_A = bool((it) % 2) # different because we haven't run
difference_to_last = 1 if it < 3 else energy[it-1] - energy[it-3] if is_A else energy[it-2] - energy[it-4] # -1 is because we haven't run
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment