You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I place a KQC element, for example the Double Pads from the Qubit Library. Then I open klayout_package/python/kqcircuits/qubits/double_pads.py and make _build_island2 return empty pya.Region(). I go back to the same KLayout session and select KQCircuits > Reload Libraries. I get what I expected, which is that the bottom island on the qubit is not present anymore and there are no errors in File > Log Viewer.
Now I open Basic from the library panel, and place a Circle. For better demonstration I double click the Circle cell, choose PCell Parameters and change Radius to 100 microns and layer to 1t1 base metal wo grid 130/1. Now do some change in double pads code (e.g. revert change made above) and try KQCircuits > Reload Libraries. Now it gives error AttributeError: type object 'PCellDeclaration_Native' has no attribute 'get_schema'. Also the double pads qubit will disappear.
views = extract_pcell_data_from_views() # Collect all cells currently placed in the KLayout session, removing them in the process
load_libraries(flush=True) # Make KLayout reload the KQC plugin code
restore_pcells_to_views(views) # Reconstruct all cells that were collected before KQC reload
It seems that the extract_pcell_data_from_views function does not filter the cells based on whether they are introduced by the KQC library or if they are native KLayout objects or cells defined from some other library. Every cell that comes from the KQC library is a subclass of kqcircuits.elements.element.Element class, so it should be easy to filter using the isinstance python function.
The described bug happens because: the macro collects the pcells, deleting some of them in the process, then it encounters a cell that it cannot work with, throws an error, and then leaves it at that - without restoring the deleted cells.
This bug should be fixed by performing the macro actions only on KQC cells, and writing a good try except block where the restore_pcells_to_views is called in case of exception.
Definition of done
Bug cannot be replicated: cells that are placed on the layout should stay there after running Reload Libraries
Tests not needed for this issue
Versions
Version independent issue
Issue Severity
Low: it is annoying
The text was updated successfully, but these errors were encountered:
What happened? What you expected to happen?
I place a KQC element, for example the Double Pads from the Qubit Library. Then I open
klayout_package/python/kqcircuits/qubits/double_pads.py
and make_build_island2
return emptypya.Region()
. I go back to the same KLayout session and selectKQCircuits > Reload Libraries
. I get what I expected, which is that the bottom island on the qubit is not present anymore and there are no errors inFile > Log Viewer
.Now I open
Basic
from the library panel, and place a Circle. For better demonstration I double click the Circle cell, choosePCell Parameters
and changeRadius
to 100 microns andlayer
to1t1 base metal wo grid 130/1
. Now do some change in double pads code (e.g. revert change made above) and tryKQCircuits > Reload Libraries
. Now it gives errorAttributeError: type object 'PCellDeclaration_Native' has no attribute 'get_schema'
. Also the double pads qubit will disappear.Prerequisites
KQCircuits GUI installation required
Where to start?
The
Reload Libraries
command is a macro at klayout_package/python/scripts/macros/0system/0reload.lym.It is an XML file with python code embedded in the
<text>
field. The macro code is simple:It seems that the
extract_pcell_data_from_views
function does not filter the cells based on whether they are introduced by the KQC library or if they are native KLayout objects or cells defined from some other library. Every cell that comes from the KQC library is a subclass of kqcircuits.elements.element.Element class, so it should be easy to filter using theisinstance
python function.The described bug happens because: the macro collects the pcells, deleting some of them in the process, then it encounters a cell that it cannot work with, throws an error, and then leaves it at that - without restoring the deleted cells.
This bug should be fixed by performing the macro actions only on KQC cells, and writing a good
try except
block where therestore_pcells_to_views
is called in case of exception.Definition of done
Reload Libraries
Versions
Version independent issue
Issue Severity
Low: it is annoying
The text was updated successfully, but these errors were encountered: