Skip to content

Commit 891523d

Browse files
committed
pass tol value in random
1 parent 7292bfb commit 891523d

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

pyxtal/crystal.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ def _set_ion_wyckoffs(self, numIon, specie, cell, wyks):
415415
new_site = atom_site(wp, pt, specie)
416416

417417
# Check current WP against existing WP's
418-
if self.check_wp(wyckoff_sites_tmp, wyks, cell, new_site):
418+
if self.check_wp(wyckoff_sites_tmp, wyks, cell, new_site, tol):
419419
if sites_list is not None and len(sites_list) > 0:
420420
sites_list.pop(0)
421421
wyckoff_sites_tmp.append(new_site)
@@ -430,12 +430,12 @@ def _set_ion_wyckoffs(self, numIon, specie, cell, wyks):
430430

431431
return None
432432

433-
def check_wp(self, wyckoff_sites_tmp, wyks, cell, new_site):
433+
def check_wp(self, wyckoff_sites_tmp, wyks, cell, new_site, tol):
434434
# Check current WP against existing WP's
435435
if new_site is None:
436436
return False
437437

438-
return all(new_site.check_with_ws2(ws, cell, self.tol_matrix) for ws in wyckoff_sites_tmp + wyks)
438+
return all(new_site.check_with_ws2(ws, cell, tol) for ws in wyckoff_sites_tmp + wyks)
439439

440440
def _check_consistency(self, site, numIon):
441441
num = 0

pyxtal/wyckoff_site.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -247,16 +247,18 @@ def get_disp(self, pos, lattice, translation):
247247
# print("++++", id, dists[id], id, diffs[id], translation) #; import sys; sys.exit()
248248
return diffs[id], dists[id]
249249

250-
def check_with_ws2(self, ws2, lattice, tm, same_group=True):
250+
def check_with_ws2(self, ws2, lattice, tol, same_group=True):
251251
"""
252252
Given two Wyckoff sites, checks the inter-atomic distances between them.
253253
254254
Args:
255255
- ws2: a different WP object (will always return False if
256256
two identical WS's are provided)
257257
- lattice: a 3x3 cell matrix
258+
- tol: tolerance value for distance checking
258259
- same_group: whether or not two WS's are in the same structure.
259260
Default value True reduces the calculation cost
261+
260262
Returns:
261263
True or False
262264
"""
@@ -265,10 +267,8 @@ def check_with_ws2(self, ws2, lattice, tm, same_group=True):
265267
if self.PBC != ws2.PBC:
266268
raise ValueError("PBC values do not match between Wyckoff sites")
267269

268-
# Get tolerance
269-
tol = tm.get_tol(self.specie, ws2.specie)
270270
# Symmetry shortcut method: check only some atoms
271-
if same_group is True:
271+
if same_group:
272272
# We can either check one atom in WS1 against all WS2, or vice-versa
273273
# Check which option is faster
274274
if self.multiplicity > ws2.multiplicity:

0 commit comments

Comments
 (0)