-
Notifications
You must be signed in to change notification settings - Fork 34
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
ALL: allow to change number of threads used for kdtree #353
base: master
Are you sure you want to change the base?
Conversation
@@ -66,6 +66,8 @@ class GITIM(Interface): | |||
:param bool warnings: Print warnings | |||
:param bool autoassign: If true (default) detect the interface | |||
every time a new frame is selected. | |||
:param int workers: Passes the workers option to scipy.spatial.cKDTree.query_ball | |||
If -1 is given all CPU threads are used (default: -1) |
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.
line too long (89 > 79 characters)
@@ -66,6 +66,8 @@ class GITIM(Interface): | |||
:param bool warnings: Print warnings | |||
:param bool autoassign: If true (default) detect the interface | |||
every time a new frame is selected. | |||
:param int workers: Passes the workers option to scipy.spatial.cKDTree.query_ball |
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.
line too long (97 > 79 characters)
>>> print(repr(inter.atoms)) | ||
<AtomGroup with 855 atoms> | ||
|
||
>>> inter = pytim.SASA( g, alpha=2.5, max_layers=2, cluster_cut=3.5, biggest_cluster_only=True, molecular=True,workers=1) |
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.
line too long (129 > 79 characters)
@@ -519,7 +524,11 @@ def _(): | |||
<AtomGroup with 2025 atoms> | |||
|
|||
|
|||
>>> inter = pytim.SASA( g, alpha=2.5, max_layers=2, cluster_cut=3.5, biggest_cluster_only=True, molecular=True) | |||
>>> inter = pytim.SASA( g, alpha=2.5, max_layers=2, cluster_cut=3.5, biggest_cluster_only=True, molecular=True,workers=-1) |
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.
line too long (130 > 79 characters)
@@ -171,7 +176,7 @@ def _define_cluster_group(self): | |||
# the smaller clusters of the other phase | |||
labels, counts, neighbors = utilities.do_cluster_analysis_dbscan( | |||
self.cluster_group, cluster_cut, | |||
self.cluster_threshold_density, self.molecular) | |||
self.cluster_threshold_density, self.molecular,workers=self.workers) |
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.
line too long (84 > 79 characters)
missing whitespace after ','
@@ -60,6 +60,8 @@ class SASA(GITIM): | |||
:param bool warnings: Print warnings | |||
:param bool autoassign: If true (default) detect the interface | |||
every time a new frame is selected. | |||
:param int workers: Passes the workers option to scipy.spatial.cKDTree.query_ball |
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.
line too long (97 > 79 characters)
@@ -56,7 +59,7 @@ def do_cluster_analysis_dbscan(group, | |||
|
|||
neighborhoods = np.array([ | |||
np.array(neighbors) | |||
for neighbors in tree.query_ball_point(points, cluster_cut, n_jobs=-1) | |||
for neighbors in tree.query_ball_point(points, cluster_cut, workers=workers) |
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.
line too long (84 > 79 characters)
@@ -46,6 +46,9 @@ def do_cluster_analysis_dbscan(group, | |||
clusters. This is on average O(N log N) thanks to the O(log N) | |||
scaling of the kdtree. | |||
|
|||
To avoid problems in environments with limited resources, |
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.
trailing whitespace
@@ -31,7 +31,7 @@ def determine_samples(threshold_density, cluster_cut, n_neighbors): | |||
def do_cluster_analysis_dbscan(group, | |||
cluster_cut, | |||
threshold_density=None, | |||
molecular=True): | |||
molecular=True,workers=1): |
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.
missing whitespace after ','
:param bool autoassign: If true (default) detect the interface | ||
every time a new frame is selected. | ||
:param int workers: Passes the workers option to scipy.spatial.cKDTree.query_ball | ||
If -1 is given all CPU threads are used (default: -1) |
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.
line too long (87 > 79 characters)
fixes #352 |
No description provided.