Sticky fill
Make fill
"sticky", fix overwrite=False
permanently (removing that option), and some related changes.
Note that the old non-sticky fill
without overwrite can be emulated by
temp = kwant.Builder()
temp.fill(model, shape, start)
syst.fill(temp, lambda s: True, start)
and non-sticky with overwrite by
temp = kwant.Builder()
temp.fill(model, shape, start)
syst.update(temp)
For two builders with same symmetry fill
is actually like update()
without a shape function and with overwrite.
Some questions:
- Should we remove
update
, since it may seem redundant? I tend to no, becauseBuilder
is a mapping, it should haveupdate
. - Should
update
extendself.leads
withother.leads
, a behavior it inherited from the now deprecated+=
? Python dictionaries don't do that, but then they don't have leads. I tend to keep updating the leads as well, since the builder from which one extends will be typically custom-made anyway, so there is little potential for surprise. Also, be updating the leads as well, theupdate
operation is closer to a real union of builders. - Should we provide a way disable the
shape
infill
, or even make this the default? Here I also tend to no, since there's the danger of "spilling", and typinglambda s: True
is quick.
Any comments?