-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add SASA collection to xtb and minor fixes. #179
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@@ -152,6 +156,7 @@ def _properties_dict(self) -> dict[str, str]: | |||
"total_free_energy": " | TOTAL FREE ENERGY ", | |||
"ionisation_potential": "delta SCC IP (eV)", | |||
"electron_affinity": "delta SCC EA (eV)", | |||
"total_sasa": "total SASA /", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why the "/" at the end ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is part of the string matching. Just the format of the output file.
Line of output file to extract property from. | ||
|
||
""" | ||
nums = re.compile(r"[+-]?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a comment which describes what kinds of things this is meant to match could be nice
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added.
@@ -87,6 +87,11 @@ class XTBEnergy: | |||
should be ``True``, however this may raise issues on | |||
clusters. | |||
|
|||
write_sasa_info: | |||
If ``True``, the detailed info input will request gbsa=True and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gbsa=True
should be inside of double backticks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
string = f"$gbsa\n gbsagrid={self._solvent_grid}" | ||
string = f"$gbsa\n gbsagrid={self._solvent_grid}\n" | ||
if self._write_sasa_info: | ||
string += "$write\n gbsa=true\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+=
on a string is a bit of an anti pattern because repeated use of it has very bad performance. While that doesnt apply here because it only happens once, consider
sasa_info = "$write\n gbsa=true\n" if self._write_sasa_info else ""
string = f"$gbsa\n gbsagrid={self._solvent_grid}\n{sasa_info}"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not realise this, updated!
src/stko/_internal/optimizers/xtb.py
Outdated
@@ -124,6 +124,11 @@ class XTB(Optimizer): | |||
encountered, this should be ``True``, however this may | |||
raise issues on clusters. | |||
|
|||
write_sasa_info: | |||
If ``True``, the detailed info input will request gbsa=True and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
double backticks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
src/stko/_internal/optimizers/xtb.py
Outdated
string = f"$gbsa\n gbsagrid={self._solvent_grid}" | ||
string = f"$gbsa\n gbsagrid={self._solvent_grid}\n" | ||
if self._write_sasa_info: | ||
string += "$write\n gbsa=true\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Related Issues: #173 #154
Requested Reviewers: @lukasturcani
Note for Reviewers: If you accept the review request add a 👍 to this post
parents=True
in allpathlib.Path.mkdir
statements