iqm-finland / KQCircuits

KLayout Python library for integrated quantum circuit design.
GNU General Public License v3.0
128 stars 71 forks source link

Macro for printing the refpoint hierarchy #13

Closed jkotilahti closed 8 months ago

jkotilahti commented 2 years ago

To help users get a better understanding of refpoints, we could have a KLayout macro that prints out a list of all refpoints in the layout. The output should be formatted so that the hierarchy of the refpoints/cells is clear.

There is now a macro that prints the refpoints (https://github.com/iqm-finland/KQCircuits/blob/main/klayout_package/python/scripts/macros/measure/print_refpoints.lym), but their hierarchy could be shown in some way in the output.

See https://iqm-finland.github.io/KQCircuits/user_guide/python_workflow.html#refpoints for an explanation about refpoints.

divshacker commented 2 years ago

Hey, I am interested in working on this issue. May I know What is KLayout macro and how it prints list? Thanks

jkotilahti commented 2 years ago

Hi @divshacker! You can find information about KLayout macros in KQCircuits documentation https://iqm-finland.github.io/KQCircuits/user_guide/macro_workflow.html and in KLayout documentation https://www.klayout.de/doc-qt5/about/macro_editor.html.

In KQCircuits we have for example the selection_length macro, which prints out lengths of waveguides to the macro editor console. If you have installed KQCircuits in KLayout, then you can find this macro in kqcircuits_scripts/macros/measure folder in Python tab of the KLayout macro editor window. If you drag-and-drop a WaveguideCoplanar element into the layout and select it, then running this macro will print out its length.

jkotilahti commented 2 years ago

A macro for printing refpoints has been implemented recently: https://github.com/iqm-finland/KQCircuits/blob/main/klayout_package/python/scripts/macros/measure/print_refpoints.lym. However, that macro currently prints all refpoints in the same way (flat list of names and locations), no matter their hierarchy.

I think we can still keep this issue open, since the point about refpoint hierarchy is not yet addressed by the macro. So the new purpose of this issue would be to improve the macro to somehow show also the hierarchy of refpoints in a clear way.

Changed the issue title and description to reflect this change now.

LeonWubben commented 8 months ago

The mentioned macro has now been adjusted to show the hierarchy. Including an option to only print the refpoints whose names or cell match a given regex and an option to only print those refpoints that are within a certain range of coordinates.