Skip to content

Commit

Permalink
consistently use f-str in filepath construction in QCJob
Browse files Browse the repository at this point in the history
  • Loading branch information
janosh committed Feb 15, 2024
1 parent f108468 commit ce09fb2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion custodian/qchem/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ def correct(self):
actions.append({"mem_static": "2000"})

elif "mem_total_too_small" in self.errors:
print("Run on a node with more memory! Current mem_total = " + str(self.outdata["mem_total"]))
print(f"Run on a node with more memory! Current mem_total = {self.outdata['mem_total']}")
return {"errors": self.errors, "actions": None}

elif "basis_not_supported" in self.errors:
Expand Down
22 changes: 11 additions & 11 deletions custodian/qchem/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,14 +309,14 @@ def opt_with_frequency_flattener(
input_file=input_file,
output_file=output_file,
qclog_file=qclog_file,
suffix=f".{opt_method}_" + str(ii),
suffix=f".{opt_method}_{ii}",
save_scratch=True,
backup=first,
**QCJob_kwargs,
)
)
opt_outdata = QCOutput(output_file + f".{opt_method}_" + str(ii)).data
opt_indata = QCInput.from_file(input_file + f".{opt_method}_" + str(ii))
opt_outdata = QCOutput(f"{output_file}.{opt_method}_{ii}").data
opt_indata = QCInput.from_file(f"{input_file}.{opt_method}_{ii}")
if opt_outdata["version"] == "6":
opt_geom_opt = copy.deepcopy(opt_indata.geom_opt)
opt_geom_opt["initial_hessian"] = "read"
Expand Down Expand Up @@ -356,15 +356,15 @@ def opt_with_frequency_flattener(
input_file=input_file,
output_file=output_file,
qclog_file=qclog_file,
suffix=".freq_" + str(ii),
suffix=f".freq_{ii}",
save_scratch=True,
backup=first,
**QCJob_kwargs,
)
)

freq_outdata = QCOutput(output_file + ".freq_" + str(ii)).data
freq_indata = QCInput.from_file(input_file + ".freq_" + str(ii))
freq_outdata = QCOutput(f"{output_file}.freq_{ii}").data
freq_indata = QCInput.from_file(f"{input_file}.freq_{ii}")
for key in freq_indata.rem:
if key not in {"job_type", "geom_opt2", "scf_guess_always"}:
if freq_rem.get(key, None) != freq_indata.rem[key]:
Expand Down Expand Up @@ -456,12 +456,12 @@ def opt_with_frequency_flattener(
input_file=input_file,
output_file=output_file,
qclog_file=qclog_file,
suffix=f".{opt_method}_" + str(ii),
suffix=f".{opt_method}_{ii}",
backup=first,
**QCJob_kwargs,
)
)
opt_outdata = QCOutput(output_file + f".{opt_method}_" + str(ii)).data
opt_outdata = QCOutput(f"{output_file}.{opt_method}_{ii}").data
if first:
orig_species = copy.deepcopy(opt_outdata.get("species"))
orig_charge = copy.deepcopy(opt_outdata.get("charge"))
Expand Down Expand Up @@ -496,13 +496,13 @@ def opt_with_frequency_flattener(
input_file=input_file,
output_file=output_file,
qclog_file=qclog_file,
suffix=".freq_" + str(ii),
suffix=f".freq_{ii}",
backup=first,
**QCJob_kwargs,
)
)
outdata = QCOutput(output_file + ".freq_" + str(ii)).data
indata = QCInput.from_file(input_file + ".freq_" + str(ii))
outdata = QCOutput(f"{output_file}.freq_{ii}").data
indata = QCInput.from_file(f"{input_file}.freq_{ii}")
if "cpscf_nseg" in indata.rem:
freq_rem["cpscf_nseg"] = indata.rem["cpscf_nseg"]
errors = outdata.get("errors")
Expand Down

0 comments on commit ce09fb2

Please sign in to comment.