3 Commits

2 changed files with 7 additions and 5 deletions

View File

@ -73,7 +73,9 @@ def checksum(*args, csum=None):
elif isinstance(arg, FunctionType): elif isinstance(arg, FunctionType):
csum.update(strip_comments(inspect.getsource(arg)).encode()) csum.update(strip_comments(inspect.getsource(arg)).encode())
c = inspect.getclosurevars(arg) c = inspect.getclosurevars(arg)
for v in {**c.nonlocals, **c.globals}.values(): merged = {**c.nonlocals, **c.globals}
for key in sorted(merged): # deterministic ordering
v = merged[key]
if v is not arg: if v is not arg:
checksum(v, csum=csum) checksum(v, csum=csum)
elif isinstance(arg, functools.partial): elif isinstance(arg, functools.partial):

View File

@ -182,10 +182,10 @@ def tetrahedral_order(
) )
# Connection vectors # Connection vectors
neighbors_1 -= atoms neighbors_1 = pbc_diff(neighbors_1, atoms, box=atoms.box)
neighbors_2 -= atoms neighbors_2 = pbc_diff(neighbors_2, atoms, box=atoms.box)
neighbors_3 -= atoms neighbors_3 = pbc_diff(neighbors_3, atoms, box=atoms.box)
neighbors_4 -= atoms neighbors_4 = pbc_diff(neighbors_4, atoms, box=atoms.box)
# Normed Connection vectors # Normed Connection vectors
neighbors_1 /= np.linalg.norm(neighbors_1, axis=-1).reshape(-1, 1) neighbors_1 /= np.linalg.norm(neighbors_1, axis=-1).reshape(-1, 1)