Comments (3)
hmm this is some messy code with a lot going on...
I recommend you start with the example here and slowly modify it towards what you need
https://gdspy.readthedocs.io/en/stable/gettingstarted.html#references
from gdspy.
- I believe
lib.new_cell()
first creates the cell, then adds it to the library. If you are creating a cell withgdspy.Cell()
instead, you should be sure to write it to a library afterwards. Then it is that library that you write to gds. - References do have a small memory footprint also. In your example, you appear to have hundreds of thousands of references, so I would still expect a somewhat considerable size, though it should still be smaller than a flattened cell, as long as each of those references is more complex than i.e. a simple rectangle. You may be able to drive down size further by using CellArrays instead.
from gdspy.
thanks @tvt173
now it can work but still have 2 questions:
- in the example you recommend, it uses "gdspy.Cell" to create a cell, but the result is empty; however, if use "lib.new_cell" instead (not only the first cell), the result can be seen with klayout, do you know why?
- now I use "lib.new_cell" to create cells (around 16), and each cell has its own references. I found the gds size will go larger along with the number of references. is that normal? I thought the size only depends on the number of cell you created, am I wrong?
Cell ("cell_final_5", 0 polygons, 0 paths, 0 labels, 2188 references)
Cell ("cell_final_6", 0 polygons, 0 paths, 0 labels, 4752 references)
Cell ("cell_final_7", 0 polygons, 0 paths, 0 labels, 6492 references)
Cell ("cell_final_8", 0 polygons, 0 paths, 0 labels, 7508 references)
Cell ("cell_final_9", 0 polygons, 0 paths, 0 labels, 10604 references)
Cell ("cell_final_10", 0 polygons, 0 paths, 0 labels, 10856 references)
Cell ("cell_final_11", 0 polygons, 0 paths, 0 labels, 14060 references)
Cell ("cell_final_12", 0 polygons, 0 paths, 0 labels, 16192 references)
Cell ("cell_final_13", 0 polygons, 0 paths, 0 labels, 19520 references)
Cell ("cell_final_14", 0 polygons, 0 paths, 0 labels, 20820 references)
Cell ("cell_final_15", 0 polygons, 0 paths, 0 labels, 21456 references)
Cell ("cell_final_16", 0 polygons, 0 paths, 0 labels, 20508 references)
Cell ("cell_final_17", 0 polygons, 0 paths, 0 labels, 19752 references)
Cell ("cell_final_18", 0 polygons, 0 paths, 0 labels, 19080 references)
Cell ("cell_final_19", 0 polygons, 0 paths, 0 labels, 20516 references)
Cell ("cell_final_20", 0 polygons, 0 paths, 0 labels, 2200 references)
from gdspy.
Related Issues (20)
- RobustPath : Unsupported types for -: 'tuple' and 'tuple' HOT 1
- Use scaling to reduce file size HOT 1
- the direction of polygon in the cellreference is wrong HOT 3
- may be it is a bug for GdsLibrary.new_cell() HOT 6
- 'Cell' object has no attribute 'elements' HOT 1
- gdspy installation in python 3.10. HOT 1
- How can I get the information of the instance?
- Use gdspy in Klayout Macro developement (reopened) HOT 1
- How to read a gds file data and export it as PNG? HOT 1
- gdspy.inside only checks for inside the bbox HOT 1
- GdsLibrary object has no attribute 'cells' HOT 2
- Multiple cells with name: FGCCTE in GDSII file HOT 2
- result of get_bounding_box() for a polygon is wrong HOT 2
- conda install gdspy
- overwrite_duplicate not working with (use_current_library = True) HOT 1
- After gdspy boolean OR operation, help HOT 1
- [0.9.46] Python extension build fails when the PYPI tarball is used HOT 1
- Python tests fail HOT 1
- Merging polygons with gdspy boolean vs Klayout merge produces different results
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gdspy.