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

Gitim fix #350

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Gitim fix #350

wants to merge 4 commits into from

Conversation

Marcello-Sega
Copy link
Owner

No description provided.

pytim/gitim.py Outdated
for atomid in simplices[i]:
close = tree_neighs.query_ball_point(_points[atomid],radii[atomid] 2*self.alpha radii[real_neighs])
if len(close)>0:
cond2[i] = False

Choose a reason for hiding this comment

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

indentation is not a multiple of four

pytim/gitim.py Outdated
# if their centers distance d < 2 alpha r_s r_n
for atomid in simplices[i]:
close = tree_neighs.query_ball_point(_points[atomid],radii[atomid] 2*self.alpha radii[real_neighs])
if len(close)>0:

Choose a reason for hiding this comment

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

indentation is not a multiple of four
missing whitespace around operator

pytim/gitim.py Outdated
# will be close to a putative surface one 's' (part of the simplex)
# if their centers distance d < 2 alpha r_s r_n
for atomid in simplices[i]:
close = tree_neighs.query_ball_point(_points[atomid],radii[atomid] 2*self.alpha radii[real_neighs])

Choose a reason for hiding this comment

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

indentation is not a multiple of four
line too long (122 > 79 characters)
missing whitespace after ','

pytim/gitim.py Outdated
# An atom 'n' in the neighborhood of the kissing sphere's center
# will be close to a putative surface one 's' (part of the simplex)
# if their centers distance d < 2 alpha r_s r_n
for atomid in simplices[i]:

Choose a reason for hiding this comment

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

indentation is not a multiple of four

pytim/gitim.py Outdated
# specify a distance that depends on the radius of the particle.
# An atom 'n' in the neighborhood of the kissing sphere's center
# will be close to a putative surface one 's' (part of the simplex)
# if their centers distance d < 2 alpha r_s r_n

Choose a reason for hiding this comment

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

indentation is not a multiple of four (comment)

pytim/gitim.py Outdated
# we will now search for those which are also close to the simplex
for i,neighbors in enumerate(neigborhoods):
if len(neighbors) > 0:
real_neighs = list(set(neighbors) - set(simplices[i]))

Choose a reason for hiding this comment

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

indentation is not a multiple of four

pytim/gitim.py Outdated
# find all atoms within the kissing sphere to each of the simplices
neighborhoods = tree.query_ball_point(x=cc[cond],r=cr[cond])
# we will now search for those which are also close to the simplex
for i,neighbors in enumerate(neigborhoods):

Choose a reason for hiding this comment

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

missing whitespace after ','
undefined name 'neigborhoods'

pytim/gitim.py Outdated
tree = cKDTree(extrapoints[:-8])
cond2 = cond | True # all True, will set them false below
# find all atoms within the kissing sphere to each of the simplices
neighborhoods = tree.query_ball_point(x=cc[cond],r=cr[cond])

Choose a reason for hiding this comment

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

local variable 'neighborhoods' is assigned to but never used
missing whitespace after ','

tree = cKDTree(extrapoints)
else:
tree = cKDTree(extrapoints[:-8])
cond2 = cond | True # all True, will set them false below

Choose a reason for hiding this comment

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

at least two spaces before inline comment
multiple spaces after operator

if self._noextrapoints:
tree = cKDTree(extrapoints)
else:
tree = cKDTree(extrapoints[:-8])

Choose a reason for hiding this comment

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

undefined name 'cKDTree'

pytim/gitim.py Outdated
for atomid in real_neighs:
d = linalgnorm(_points[simplices[i]]-tree.data[atomid],axis=1)
if np.count_nonzero(d-radii[atomid]-radii[simplices[i]] - 2.*self.alpha<0) > 1:
cond2[i] = False

Choose a reason for hiding this comment

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

over-indented

pytim/gitim.py Outdated
real_neighs = list(set(neighbors) -set(neighborhoods2[i])- set(simplices[i]))
for atomid in real_neighs:
d = linalgnorm(_points[simplices[i]]-tree.data[atomid],axis=1)
if np.count_nonzero(d-radii[atomid]-radii[simplices[i]] - 2.*self.alpha<0) > 1:

Choose a reason for hiding this comment

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

line too long (95 > 79 characters)
missing whitespace around operator

pytim/gitim.py Outdated
# To be sure, we alse remove points belonging to the kissed simplex as well.
real_neighs = list(set(neighbors) -set(neighborhoods2[i])- set(simplices[i]))
for atomid in real_neighs:
d = linalgnorm(_points[simplices[i]]-tree.data[atomid],axis=1)

Choose a reason for hiding this comment

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

missing whitespace after ','

for i,neighbors in enumerate(neighborhoods1):
# we are not interested in points either too far away from the sphere border.
# To be sure, we alse remove points belonging to the kissed simplex as well.
real_neighs = list(set(neighbors) -set(neighborhoods2[i])- set(simplices[i]))

Choose a reason for hiding this comment

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

line too long (89 > 79 characters)
missing whitespace around operator

# we will now search for those which are also close to the simplex
for i,neighbors in enumerate(neighborhoods1):
# we are not interested in points either too far away from the sphere border.
# To be sure, we alse remove points belonging to the kissed simplex as well.

Choose a reason for hiding this comment

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

line too long (88 > 79 characters)

neighborhoods1 = tree.query_ball_point(x=cc[cond],r=cr[cond])
radii2 = cr[cond]-2*self.alpha
radii2[radii2<0] = 0.0 # query_ball_point treats negative radii as positive...
# if they are within the kissing sphere, but further than 2*alpha from its

Choose a reason for hiding this comment

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

line too long (82 > 79 characters)

# find all atoms within the kissing sphere to each of the simplices
neighborhoods1 = tree.query_ball_point(x=cc[cond],r=cr[cond])
radii2 = cr[cond]-2*self.alpha
radii2[radii2<0] = 0.0 # query_ball_point treats negative radii as positive...

Choose a reason for hiding this comment

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

at least two spaces before inline comment
line too long (86 > 79 characters)
missing whitespace around operator

tree = cKDTree(extrapoints[:-8])
cond2 = cond | True # all True, will set them false below
# find all atoms within the kissing sphere to each of the simplices
neighborhoods1 = tree.query_ball_point(x=cc[cond],r=cr[cond])

Choose a reason for hiding this comment

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

missing whitespace after ','

@@ -221,10 223,36 @@ def alpha_shape(self, alpha, group, layer):
except IndexError:
raise IndexError("alpha_shape called using a wrong layer")

cr = circumradius(_points, radii, simplices)
# radii and centers of the kissing spheres
cr,cc = circumradius(_points, radii, simplices)

Choose a reason for hiding this comment

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

missing whitespace after ','

neighborhoods = np.array([
np.array(neighbors)
for neighbors in tree.query_ball_point(points, cluster_cut, n_jobs=-1)
])
],dtype=object)

Choose a reason for hiding this comment

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

missing whitespace after ','

@@ -279,6 319,8 @@ def _assign_layers(self):
alpha_ids = self.alpha_shape(self.alpha, alpha_group, layer)

group = alpha_group[alpha_ids]
if self.surface_cluster_cut is not None:
group=self._filter_biggest_surface_cluster(group,self.surface_cluster_cut)

Choose a reason for hiding this comment

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

line too long (90 > 79 characters)
missing whitespace after ','
missing whitespace around operator

for atomid in real_neighs:
d = linalgnorm(_points[simplices[sid][0]]-tree.data[atomid],axis=1)
if np.count_nonzero(d-radii[atomid]-radii[simplices[sid][0]] - 2.*self.alpha<0) > 1:
cond2[sid] = False

Choose a reason for hiding this comment

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

over-indented

real_neighs = list(set(neighbors) -set(neighborhoods2[i])- set(simplices[i]))
for atomid in real_neighs:
d = linalgnorm(_points[simplices[sid][0]]-tree.data[atomid],axis=1)
if np.count_nonzero(d-radii[atomid]-radii[simplices[sid][0]] - 2.*self.alpha<0) > 1:

Choose a reason for hiding this comment

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

line too long (100 > 79 characters)
missing whitespace around operator

# To be sure, we alse remove points belonging to the kissed simplex as well.
real_neighs = list(set(neighbors) -set(neighborhoods2[i])- set(simplices[i]))
for atomid in real_neighs:
d = linalgnorm(_points[simplices[sid][0]]-tree.data[atomid],axis=1)

Choose a reason for hiding this comment

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

line too long (83 > 79 characters)
missing whitespace after ','

to filter out cavitating bubbles.
:param float surface_cluster_cut: Filter surface atoms/molecules
to include only those in the largest cluster
of (initially detected) surface ones. Useful

Choose a reason for hiding this comment

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

line too long (80 > 79 characters)

@@ -58,6 60,16 @@ class GITIM(Interface):
:param bool biggest_cluster_only: Tag as surface atoms/molecules only
those in the largest cluster. Need to
specify also a :py:obj:`cluster_cut` value.
:param bool biggest_surface_cluster_only: Filter surface atoms/molecules
to include only those in the largest cluster

Choose a reason for hiding this comment

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

line too long (80 > 79 characters)

@@ -58,6 60,16 @@ class GITIM(Interface):
:param bool biggest_cluster_only: Tag as surface atoms/molecules only
those in the largest cluster. Need to
specify also a :py:obj:`cluster_cut` value.
:param bool biggest_surface_cluster_only: Filter surface atoms/molecules

Choose a reason for hiding this comment

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

line too long (80 > 79 characters)
trailing whitespace

l,c,n = utilities.do_cluster_analysis_dbscan(
group, cut,
molecular=False)
return group[np.where(l == np.argmax(c))[0]]

Choose a reason for hiding this comment

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

ambiguous variable name 'l'

@@ -145,6 145,12 @@ def _assign_symmetry(self, symmetry):
raise ValueError(messages.WRONG_DIRECTION)
self.symmetry = symmetry

def _filter_biggest_surface_cluster(self,group,cut):
l,c,n = utilities.do_cluster_analysis_dbscan(

Choose a reason for hiding this comment

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

missing whitespace after ','

@@ -145,6 145,12 @@ def _assign_symmetry(self, symmetry):
raise ValueError(messages.WRONG_DIRECTION)
self.symmetry = symmetry

def _filter_biggest_surface_cluster(self,group,cut):

Choose a reason for hiding this comment

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

missing whitespace after ','

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