Skip to content

Conversation

@rubengerritsen
Copy link
Collaborator

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

It still misses tests.

@rubengerritsen rubengerritsen requested a review from felipeZ March 26, 2021 13:29
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.

3 participants