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 numerical polarizability #33

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

Conversation

rubengerritsen
Copy link
Collaborator

Start of a tool to compute the numerical polarizability of a molecule in different states.

It still misses tests.

Copy link
Member

@felipeZ felipeZ left a comment

Choose a reason for hiding this comment

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

@rubengerritsen good job!
I am missing some tests for the new functionality that you have introduced.

b = [self.dE, -self.dE, 0.0]
a = [b, b, b]
perm = [element for element in itertools.product(*a)]
perm = [s for s in perm if all(s) == False]
Copy link
Member

Choose a reason for hiding this comment

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

comparing to bool is usually not recommended, instead you can do the following:

perm = [s for s in perm if not all(s)]

self.dE = dE
self.path = path_to_simulations

def mkfldr(self, path: str):
Copy link
Member

Choose a reason for hiding this comment

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

Do you want to raise an error whenever the directory already exists? what kind of errors are you trying to catch?
I think that you are looking for something like:

os.makedirs(name, exist_ok=True)

or

from pathlib import Path
Path(name).mkdir(parents=True, exist_ok=True)

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.

None yet

2 participants