Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Python 3 and GDS shape properties #109
This bug refers to https://www.klayout.de/forum/comments.php?DiscussionID=1048.
The following code won't retrieve the shape property with key 2 on the attached layout with Python 3.
Reason: the strongly typed keys changed to 64 bit in Python 3 on Windows. On Linux, 32 and 64bit are equivalent (the internal type is long which is == long long). Still the problem exists because of the Windows-induced strong typing.
This is a (slow) workaround:
Yes ... basically you can use the properties for any purpose you want. Some tools output net names for example as properties ("annotated GDS"). So you can basically select shapes by their circuit names. But AFAIK there is no common agreement what properties to use.
BTW: the bug should reproduce on Python 3/64 bit. The reason is long/long long differentiation in the compiler (actually there is no difference except on Windows, but the compiler does not take these values as the same type). I could reproduce the issue on Linux myself.
Hi Juras, "#l2" should not be an issue. The lower case "l" indicates "long" (always 64bit) keys. That's required as OASIS supports long keys and Python 3 can potentially generate them. When you save to GDS and load again, the "long" key will change to "#2" because it's normalized to "normal int" (32bit on 32bit Linux and on Windows, 64bit on 64bit Linux), but you can still retrieve it with property(2) - regardless whether the key is "#l2" or "#2". Both are interchangable except for different value range on Windows and 32bit Linux. Thanks for testing, Matthias Quoting jurask <firstname.lastname@example.org>:…
I have tried to build the last git version. It seems like that user properties are now correctly detected in the shape.property function. Unfortunatelly the shape.set_property(2, 'aaa') still creates #l2 instead of #2. Thanks for any response Juras -- You are receiving this because you modified the open/close state. Reply to this email directly or view it on GitHub: #109 (comment)