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

ports are not hashable #510

Open
joamatab opened this issue Nov 11, 2024 · 0 comments
Open

ports are not hashable #510

joamatab opened this issue Nov 11, 2024 · 0 comments

Comments

@joamatab
Copy link
Collaborator

import kfactory as kf


class LayerInfos(kf.LayerInfos):
    WG: kf.kdb.LayerInfo = kf.kdb.LayerInfo(1, 0)
    WGEX: kf.kdb.LayerInfo = kf.kdb.LayerInfo(2, 0)  # WG Exclude
    CLAD: kf.kdb.LayerInfo = kf.kdb.LayerInfo(4, 0)  # cladding
    FLOORPLAN: kf.kdb.LayerInfo = kf.kdb.LayerInfo(10, 0)


# Make the layout object aware of the new layers:
LAYER = LayerInfos()
kf.kcl.infos = LAYER


@kf.cell
def port_hashable(p1):
    print(f"port_hashable {p1}")
    return kf.cells.straight.straight(width=1, length=1, layer=LAYER.WG)


if __name__ == "__main__":
    c0 = kf.cells.straight.straight(width=1, length=1, layer=LAYER.WG)
    c1 = port_hashable(c0["o1"])

TypeError: unhashable type: 'Port'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant