gdsfactory / kfactory

gdsfactory with a klayout backend
https://gdsfactory.github.io/kfactory/
MIT License
34 stars 13 forks source link

Function `apply_bbox()` does not work with `LayerInfo` #467

Closed akshat-ja closed 2 months ago

akshat-ja commented 2 months ago

Describe the bug

When ref is LayerInfo it returns False. We could add an _is_LayerInfo() function under _is_int() to check this and another if statement here in enclosure.py to accept the LayerInfo input.

Lines 988-991 in ./kfactory/enclosure.py:

        if _is_int(ref):
            _ref = c.bbox(ref)
        elif _is_Region(ref):
            _ref = ref.bbox()
akshat-ja commented 2 months ago

@gdspaul

sebastian-goeldi commented 2 months ago

I think it's not necessary to use the type guards anymore. the type checkers got better by now.