sisl
sisl copied to clipboard
cleaned finder and removed pbc (getting it from Lattice)
The neighbor finder got an overhaul to check for PBC and friends.
- Deleted
pbc
arguments to routines, they now get it from thegeometry
object contained. - The
find_all_unique_pairs
changed named tofind_unique_pairs
(all was superfluous) - I tried to make a test (see final test in the
test_finder.py
where one is located outside the unit cell. This problem is also inherent to the current way of doing things, but I wanted to give it a try here as well. And I found the same problem. I.e. if one runs this small snippet one also gets:
import sisl as si
geom = si.Geometry([[0, 0, 0], [3, 0, 0]], lattice=[2, 10, 10])
n = si.geom.NeighborFinder(geom, R=1.1)
print(n.find_neighbors())
output
[array([[ 1, -1, 0, 0]]), array([], shape=(0, 4), dtype=int64)]
@pfebrer you have any clue was goes on here?
Also, we need to discuss what should be done. Because the current way things are handled (in both this and the old part of the code) needs to be fixed in one way. I don't know if one should always do a translation to the UC for PB directions, and then special care should be done along non PB directions.