It looks like you're new here. If you want to get involved, click one of these buttons!
Hello, I encounter this error when I try to run my code in linux. It perfectly works in windows.
For debugging I have put some print statements. I will put the output of the print statements as comment.
layout_dbu = 10000 output_layout = pya.Layout() output_layout.dbu = 1 / layout_dbu subcell = output_layout.cell('mycell') print(polygon) ### (-0.15,-4;-0.15,4;0.15,4;0.15,-4) print(type(polygon)) ### <class 'pya.DPolygon'> print(the_layer) #### 0 print(type(the_layer)) ## <type 'long'> subcell.shapes(the_layer).insert(polygon)
It is giving me the following error:
ERROR: /var/lib/jenkins/workspace/multibranch-centos7_staging/src/db/db/dbTrans.h,1619,mag > 0.0
ERROR: Internal error: /var/lib/jenkins/workspace/multibranch-centos7_staging/src/db/db/dbTrans.h:1619 mag > 0.0 was not true in Shapes.insert
Another interesting thing I have noticed is that, this error goes away when I comment out this part:
output_layout.dbu = 1/layout_dbu
The source code is very long that's why I have just put the relevant part. Please let me know if this information is not enough.
Hi @Ege_Bey I quickly checked on my end whether I can reproduce the error. I cannot. For reference I used the following code
Are you by any chance using KLayout with a python 2.7 environment? In python 2.7
1/10000 == 0since it is evaluated as an integer division. And a database unit of 0 won't work . In that case you should do
layout.dbu = 1./10000. If I manually add
layout.dbu = 0, I will get the exact error you get
Btw the print statements won't work with python < 3.9 (maybe it works with 3.8, can't remember when they added these nice f string prints ).
Hope this helps
P.S. I would strongly recommend updating to a KLayout version which uses python3 (preferably >= 3.7) as python 2.7 is now not maintained any more at all
Thanks a lot! setting layout.dbu = 1./10000 solved my problem
It is amazing what single "." can do That "." could cause me hours of struggle!
Thanks again !
@sebastian Thanks a lot. That's a very valuable comment indeed!