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

show_subports causes error with CellArray references #791

Closed
tvt173 opened this issue Oct 27, 2022 · 1 comment
Closed

show_subports causes error with CellArray references #791

tvt173 opened this issue Oct 27, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@tvt173
Copy link
Collaborator

tvt173 commented Oct 27, 2022

Describe the bug
When a cell has a CellArray reference, i.e. added with c.add_array(), and then it is shown with show_subports=True, it throws an error: AttributeError: 'CellArray' object has no attribute 'get_ports_list'

To Reproduce

    c = gf.Component()
    c.add_array(gf.components.straight())
    c.show(show_ports=True, show_subports=True)

Expected behavior
In this case, the reference type is actually a gdspy CellArray, which doesn't have ports, so we should probably just skip the references which are not of type ComponentReference.

Suggested fix
On line 1231 of component.py, only call add_pins_triangle() if the reference is of type ComponentReference

@tvt173 tvt173 added the bug Something isn't working label Oct 27, 2022
@joamatab
Copy link
Contributor

Thank you Troy!

fixed here
#794

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

No branches or pull requests

2 participants