Skip to content

Commit

Permalink
Update _rdf.py
Browse files Browse the repository at this point in the history
Signed-off-by: Zishen Wang <[email protected]>
  • Loading branch information
zz11ss11zz authored Sep 21, 2024
1 parent 84fa811 commit db84cb2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/maml/describers/_rdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ def get_pair_distances(structure: Structure, r_max: float = 8.0) -> list[dict]:
species = np.array([str(i.specie) for i in structure.sites])
res = [{"specie": i, "neighbors": {}} for i in species]
neighbor_species = species[index2]
tuples = np.array(list(zip(index1, neighbor_species, strict=False)), dtype=[("index", "i4"), ("specie", "<U10")])
tuples = np.array(list(zip(index1, neighbor_species)), dtype=[("index", "i4"), ("specie", "<U10")])
unique_tuples, indices = np.unique(tuples, return_inverse=True)
for _index, unique_tuple in enumerate(unique_tuples):
res[unique_tuple[0]]["neighbors"][unique_tuple[1]] = distances[tuples == unique_tuple]
Expand Down

0 comments on commit db84cb2

Please sign in to comment.