Skip to content

Commit

Permalink
Update strings.
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewtarzia committed Jul 20, 2024
1 parent 61024eb commit 2661081
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions src/stko/_internal/calculators/xtb_calculators.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,8 @@ def _check_path(self, path: Path) -> None:
raise PathError(msg)

def _write_detailed_control(self) -> None:
string = f"$gbsa\n gbsagrid={self._solvent_grid}\n"
if self._write_sasa_info:
string += "$write\n gbsa=true\n"
sasa_info = "$write\n gbsa=true\n" if self._write_sasa_info else ""
string = f"$gbsa\n gbsagrid={self._solvent_grid}\n{sasa_info}"

Path("det_control.in").write_text(string)

Expand Down
5 changes: 2 additions & 3 deletions src/stko/_internal/optimizers/xtb.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,9 +393,8 @@ def _run_xtb(self, xyz: str, out_file: Path | str) -> None:
)

def _write_detailed_control(self) -> None:
string = f"$gbsa\n gbsagrid={self._solvent_grid}\n"
if self._write_sasa_info:
string += "$write\n gbsa=true\n"
sasa_info = "$write\n gbsa=true\n" if self._write_sasa_info else ""
string = f"$gbsa\n gbsagrid={self._solvent_grid}\n{sasa_info}"

with Path("det_control.in").open("w") as f:
f.write(string)
Expand Down

0 comments on commit 2661081

Please sign in to comment.