Skip to content

Commit

Permalink
Merge pull request #638 from HEXRD/dbscan-parallel
Browse files Browse the repository at this point in the history
Run dbscan in parallel
  • Loading branch information
psavery authored May 17, 2024
2 parents 72fa791 + b47dd38 commit 30e7f0d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions hexrd/findorientations.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,8 @@ def run_cluster(compl, qfib, qsym, cfg,
cl_radius = cfg.find_orientations.clustering.radius
min_compl = cfg.find_orientations.clustering.completeness

ncpus = cfg.multiprocessing

# check for override on completeness threshold
if compl_thresh is not None:
min_compl = compl_thresh
Expand Down Expand Up @@ -295,7 +297,8 @@ def quat_distance(x, y):
pdist,
eps=np.radians(cl_radius),
min_samples=min_samples,
metric='precomputed'
metric='precomputed',
n_jobs=ncpus,
)
else:
if algorithm == 'ort-dbscan':
Expand All @@ -312,7 +315,9 @@ def quat_distance(x, y):
pts,
eps=eps,
min_samples=min_samples,
metric='minkowski', p=2,
metric='minkowski',
p=2,
n_jobs=ncpus,
)

# extract cluster labels
Expand Down

0 comments on commit 30e7f0d

Please sign in to comment.