Comments (6)
Hi Lucas,
we usually don't mix pya
, (the GUI API for klayout) and gf.kdb
(the python API)
something klayout does internally to store the metadata from Component.ports, component.info and component.settings is to create a second cell
from gdsfactory.
Hi Joaquin,
I was running this test in VSCode, not in the GUI. I removed the line "import pya". I still get the extra cells. My code did not instantiate the straight and taper cells. So there must be some memory leak or other bug in gdsfactory that is creating these additional cells, and reducing the performance.
from gdsfactory.
hi Lukas,
this works great for me
import gdsfactory as gf
c = gf.Component()
mmi = c.add_ref(gf.components.mmi1x2())
c.write_gds('/tmp/2.gds')
c.show()
from gdsfactory.
Hi @joamatab
Indeed, there are two ways to save the file:
layout.write('/tmp/1.gds')
c.write_gds('/tmp/2.gds')
The 2nd one works, as shown in the screenshots above. The 1st method works but adds two extra cells.
from gdsfactory.
The 2 extra cells can come from double wrapped components
If you do
@gf.cell
def my_straight():
return gf.c.straight()
The @cell
will detect that the initial cell is already locked and create a new one. This is most likely where the extra cells come from.
So indeed c.write_gds
is the best approach as the layout/kcl write will all cells in the layout. You can selectively exclude within the save_options though
from gdsfactory.
Also, please be aware, if you resort to layout().write(...)
etc, you are circumventing a lot of gdsfactory sanitory checks as well as dropping (most if not all) meta infos and therefore will not be able to use any operation relying on read and reconstructed meta info such as http://sami.klayout.org/preview?url=git%2Bhttps%3A%2F%2Fgithub.com%2Fgdsfactory%2Fmetainfo-ports.git%2Bklayout%5Bv0.0.6%5D or when reading gds files into gdsfactory again.
The proper gdsfactory operation is write_gds
or if pure kfactory gf.kcl.write(...)
from gdsfactory.
Related Issues (20)
- Reintegrate c.plot_matplotlib() HOT 7
- What motivated the change to `gf.components.bbox`? HOT 3
- add_fiber_array reports duplicate port names HOT 5
- v8.0.0: ComponentAlongPath is not hashable HOT 3
- Migration script over-capturing HOT 2
- component.show() not working when using watch
- add_pins not working properly HOT 2
- nets as dicts HOT 4
- Gdsfactory 8: cell.get_polygons() does not return datatypes HOT 2
- Spiral Features in v8.1 removed HOT 1
- Regression when creating an mzi. Maybe something wrong with reference.mirror() ? HOT 5
- ComponentReference made from ComponentAllAngle gives strange error HOT 7
- gf.path.transition(width_type='linear') coming out with nonlinear width variation for some cases HOT 2
- ValueError: xx is not a valid LAYER HOT 4
- Potential errors in taper_cross_section function when creating tapers with certain layer numbers HOT 1
- installation on Python in KLayout HOT 7
- add_ref will truncate long name s HOT 6
- Naming Cells in Hierarchical Components HOT 5
- max_cellname_length being ignored HOT 3
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 gdsfactory.