Skip to content

Fix insert_vinsts and use its recursive argument#882

Open
abdelq wants to merge 2 commits intogdsfactory:mainfrom
abdelq:abdelq/insert_vinsts
Open

Fix insert_vinsts and use its recursive argument#882
abdelq wants to merge 2 commits intogdsfactory:mainfrom
abdelq:abdelq/insert_vinsts

Conversation

@abdelq
Copy link
Contributor

@abdelq abdelq commented Feb 9, 2026

Summary

The intersection is done at the wrong spot leading to empty set. Also recursive was not being used.

Test Plan

Tested on private repo's code.

@abdelq
Copy link
Contributor Author

abdelq commented Feb 9, 2026

Maybe write and write_bytes should also drop the insert_into loop if it's handled here?

@dansgithubuser
Copy link

I'm curious what's the point of the & self.kcl.tkcells.keys(). Is it ever not a no-op?

@sebastian-goeldi sebastian-goeldi added the bug Something isn't working label Feb 10, 2026
@sebastian-goeldi
Copy link
Collaborator

sebastian-goeldi commented Feb 10, 2026

I'm curious what's the point of the & self.kcl.tkcells.keys(). Is it ever not a no-op?

In case it's been manually manipulated yes. This can theoretically happen if someone changes kcl manually. It can crash really hard if that happens, and the klayout errors can be very no fun when that happens

Sorry, maybe I misremember. But I believe if you clean up the layout object, it can have an impact, but I can't remember exactly why I added it. But it was related to having klayout segfault bc accessing an invalid index at some point

@sebastian-goeldi
Copy link
Collaborator

Maybe write and write_bytes should also drop the insert_into loop if it's handled here?

yes that sounds good, can you add it to the PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants