Interface compatibility between Lattice.shape and Builder.fill
There were two minor changes in interface:
-
lat.shape
accepts real-space position in shape function,builder.fill
accepts site. This is a good change, as for me, and allows shorter code in some cases. However, it may be reasonable to keep backward compatibility and check type of an argument for the purpose of not annoying users (at least before issuing Kwant 2). -
lat.shape
accepted real-space position of an origin for flood-fill,builder.fill
accepts site tag. When (0, 0) can't be chosen as an origin, user has routinely to use something like:lat = next(iter(proto.sites())).family start = lat.closest((x0, y0))
I don't see any good reason for not doing this automatically in
kwant.Builder.fill
method and keep old-style interface.