pyiron / pyiron/structuretoolkit
`get_neighborhood` does not work when `cutoff_radius` is specified
Open
@samwaseda is already working on this.
Since Feb 23, 2024.
bug
- Dominant language
- Python
- Stars
- 8
- Forks
- 1
- Avg merge
- 1d 28m
- Merged PRs (30d)
- 10
Description
It's actually a very rare case, but the following code does not work:
from pyiron_atomistics import Project
a_0 = 3.4812
structure = Project(".").create.structure.bulk('Fe', cubic=True, crystalstructure='fcc', a=a_0).repeat(5)
neigh = structure.get_neighbors(num_neighbors=12)
narrow_paths = structure.positions[:, None, :] + neigh.vecs * 0.5
narrow_paths = narrow_paths[neigh.indices > neigh.atom_numbers]
structure.get_neighborhood(narrow_paths, num_neighbors=None, cutoff_radius=5).distances.max()
Output : inf (while it should be some finite number since different points do not have different neighborhood)
The reason is get_extended_positions from structuretoolkit.common.helper does not correctly calculate the distance of external points to the nearest point in the box. I always knew that this could be a problem but I guess I should come up with a decent algorithm.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.