klayout
klayout copied to clipboard
Allow the usage of `Cell.shapes(LayerInfo(...))`
Hi Matthias,
I'll cut to the chase directly: Would it be possible to allow Cell.shapes
to take a LayerInfo object and have it resolve it to the layer_index internally? If easily possible this would also be nice for Cell.begin_shapes_rec(...)
and its friends. But those are less affected than shapes due to infrequent use of those.
The longer story:
I am currently working on expanding the use of (gds)pdks (well, pdk is a very advanced word for where we are in photonics, but you get the general idea) across multiple layouts (in order to essentially separate cells into more or less standard cells and cells generated specifically for the tapeout such as new structures for tests etc).
One of the big struggles I encountered is that most of my end-users do not really understand why a layer index is kind of bound to the layout. So, I have essentially rewritten (or rather hidden deeper in the code) an enum for the layer indexes to mainly use LayerInfo objects instead.
But now I have the problem of having to explain to users why they have to do c.shapes(c.layout().find_layer(LayerInfo(...)))
(of course this is a bit less explicit than here, but for illustration purposes it's in pure klayout code).
Best, Sebastian