Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Last `item.data()` of `pya.LayoutQuery` returns `None` #261

Closed
olcc opened this issue Apr 13, 2019 · 2 comments

Comments

@olcc
Copy link

commented Apr 13, 2019

This ticket refers to this issue mentioned in the forum: https://www.klayout.de/forum/discussion/1218/custom-query-in-a-python-script-bugs

In a query like below, the last item.data() unduly returns None. In particular, if there is only one cell instance matching the query, the result is result = [None], which is disappointing.

query = "select cell.name from instances of .. where cell_name ~ 'CellName1'"
result = [item.data() for item in pya.LayoutQuery(query).each(layout)]

Olivier (KLayout 0.25.8, Debian Linux)

@klayoutmatthias

This comment has been minimized.

Copy link
Collaborator

commented Apr 16, 2019

Hi Olivier,

thanks for this issue report. I can reproduce it, but that does not seem to be a systematic issue. With "search and replace" the result is fine. I'll check the Python integration code.

Regards,

Matthias

@klayoutmatthias

This comment has been minimized.

Copy link
Collaborator

commented Apr 16, 2019

I guess I found the root cause. I'll give it some testing and then merge it.

klayoutmatthias added a commit that referenced this issue Apr 17, 2019
Merge pull request #262 from KLayout/issue-261
Fixed #261 (iterator must not be incremented while value is used)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.