Skip to content

Commit

Permalink
Debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
choglass committed Jan 4, 2025
1 parent abf8779 commit 75e470f
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions cell2mol/connectivity.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,12 +272,16 @@ def get_adjmatrix(labels: list, pos: list, cov_factor: float=1.3, radii="default
for j in range(i, natoms):
if i != j:
if (elemdatabase.elementgroup[labels[i]] == 2 or elemdatabase.elementgroup[labels[j]] == 2) :
adjmat[i, j] = 0
adjmat[j, i] = 0
elif (labels[i] != "H" and labels[j] != "H") and (labels[i] != "D" and labels[j] != "D"):
if (elemdatabase.elementgroup[labels[i]] == 1 or elemdatabase.elementgroup[labels[j]] == 1 ):
if adjmat[i, j] == 1 or adjmat[j, i] == 1:
print("Adjacency Matrix: Alkali or Alkaline Earth Metal", labels[i], labels[j], f"{i=}", f"{j=}", f"{adjmat[i, j]=}")
adjmat[i, j] = 0
adjmat[j, i] = 0
adjmat[j, i] = 0
elif (labels[i] != "H" and labels[j] != "H") and (labels[i] != "D" and labels[j] != "D"):
if (elemdatabase.elementgroup[labels[i]] == 1 or elemdatabase.elementgroup[labels[j]] == 1 ):
if adjmat[i, j] == 1 or adjmat[j, i] == 1:
print("Adjacency Matrix: Alkali or Alkaline Earth Metal", labels[i], labels[j], f"{i=}", f"{j=}", f"{adjmat[i, j]=}")
adjmat[i, j] = 0
adjmat[j, i] = 0

# Sums the adjacencies of each atom to obtain "adjnum"
for i in range(0, natoms):
Expand Down

0 comments on commit 75e470f

Please sign in to comment.