Skip to content
Snippets Groups Projects
Commit 88ca6354 authored by Daria M. Tomecka's avatar Daria M. Tomecka
Browse files

cleaaning up the code and removing repetition

parent 8a086923
No related branches found
No related tags found
No related merge requests found
...@@ -72,26 +72,6 @@ def get_normalized_wyckoff(atomic_number, wyckoff): ...@@ -72,26 +72,6 @@ def get_normalized_wyckoff(atomic_number, wyckoff):
sortedWyc = list(wycDict.keys()) sortedWyc = list(wycDict.keys())
sortedWyc.sort() sortedWyc.sort()
def cmpp(a, b):
return ((a < b) - (a > b))
def compareAtNr(at1, at2):
"""Returns a normalized Wyckoff sequence for the given atomic numbers and
wyckoff symbols.
"""
# print("at", atomic_number, wyckoff)
atomCount = {}
for nr in atomic_number:
atomCount[nr] = atomCount.get(nr, 0) + 1
wycDict = {}
for i, wk in enumerate(wyckoff):
oldVal = wycDict.get(wk, {})
nr = atomic_number[i]
oldVal[nr] = oldVal.get(nr, 0) + 1
wycDict[wk] = oldVal
sortedWyc = list(wycDict.keys())
sortedWyc.sort()
def cmpp(a, b): def cmpp(a, b):
return ((a < b) - (a > b)) return ((a < b) - (a > b))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment