freude / NanoNet

The project represents an extendable Python framework for the electronic structure computations based on the tight-binding method and transport modeling based on the non-equilibrium Green's function (NEGF) method. The code can deal with both finite and periodic system translated in one, two or three dimensions.
MIT License
32 stars 14 forks source link

duplicate of the function "get_neighbours" #50

Closed stripey-tiger closed 6 years ago

stripey-tiger commented 6 years ago

why are there two copies of this function? i have highlighted the second copy, which is superfluous (see below)

https://github.com/freude/NanoNet/blob/c9805d550d28d3684cdce8c8ab40903d0bfa45e2/tb/structure_designer.py#L46-L69

freude commented 6 years ago

On is to find neighbors for an isolated structure without periodic translation. Another works for finding neighbors across interfaces. Since they look almost the same, it is not the best code style. So I am going to refactor classes StructureDesigner and CyclicTopology to make them sharing the function get_neighbours(). Probably one class should inherit this function from another. In any case, I am agree the code is not optimal here and has to be fixed. It is good to have it as an issue.

freude commented 6 years ago

The issue is solved