Skip to content
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

Merged
merged 13 commits into from
Jul 24, 2024

Conversation

andrewtarzia
Copy link
Member

@andrewtarzia andrewtarzia commented Jul 9, 2024

Related Issues: #173 #154
Requested Reviewers: @lukasturcani
Note for Reviewers: If you accept the review request add a 👍 to this post

  1. Adds a minor feature to collect the SASA from xTB output
  2. Makes some utilities used by other codes public
  3. uses parents=True in all pathlib.Path.mkdir statements

@andrewtarzia andrewtarzia self-assigned this Jul 9, 2024
@andrewtarzia andrewtarzia marked this pull request as ready for review July 19, 2024 10:29
Copy link
Contributor

@lukasturcani lukasturcani left a 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 /",
Copy link
Contributor

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 ?

Copy link
Member Author

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+)?")
Copy link
Contributor

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

Copy link
Member Author

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
Copy link
Contributor

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

Copy link
Member Author

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"
Copy link
Contributor

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}"

Copy link
Member Author

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!

@@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

double backticks

Copy link
Member Author

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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@andrewtarzia andrewtarzia merged commit 4f161aa into JelfsMaterialsGroup:master Jul 24, 2024
4 checks passed
@andrewtarzia andrewtarzia deleted the minor branch July 24, 2024 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants