Skip to content

Commit

Permalink
Merge branch 'main' into steppers
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastian-goeldi authored Oct 11, 2024
2 parents 2d480eb + 413701d commit 5bdc6b1
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 5 deletions.
26 changes: 21 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
<a name="v0.20.9"></a>
# [v0.20.9](https://github.com/gdsfactory/kfactory/releases/tag/v0.20.9) - 10 Oct 2024
<a name="v0.21.1"></a>
# [v0.21.1](https://github.com/gdsfactory/kfactory/releases/tag/v0.21.1) - 11 Oct 2024

# What's Changed

## New

- add instance iterator which returns coord plus port [#491](https://github.com/gdsfactory/kfactory/pull/491)

**Full Changelog**: https://github.com/gdsfactory/kfactory/compare/v0.21.0...v0.21.1


[Changes][v0.21.1]


<a name="v0.21.0"></a>
# [v0.21.0](https://github.com/gdsfactory/kfactory/releases/tag/v0.21.0) - 10 Oct 2024

# What's Changed

Expand All @@ -13,10 +28,10 @@
- fix naming of cells from vinsts [#489](https://github.com/gdsfactory/kfactory/pull/489)
- fix route_bundle bbox ignore for single route (or matching opposite side) [#488](https://github.com/gdsfactory/kfactory/pull/488)

**Full Changelog**: https://github.com/gdsfactory/kfactory/compare/v0.20.8...v0.20.9
**Full Changelog**: https://github.com/gdsfactory/kfactory/compare/v0.20.8...v0.21.0


[Changes][v0.20.9]
[Changes][v0.21.0]


<a name="v0.20.8"></a>
Expand Down Expand Up @@ -1168,7 +1183,8 @@
[Changes][v0.4.0]


[v0.20.9]: https://github.com/gdsfactory/kfactory/compare/v0.20.8...v0.20.9
[v0.21.1]: https://github.com/gdsfactory/kfactory/compare/v0.21.0...v0.21.1
[v0.21.0]: https://github.com/gdsfactory/kfactory/compare/v0.20.8...v0.21.0
[v0.20.8]: https://github.com/gdsfactory/kfactory/compare/v0.20.7...v0.20.8
[v0.20.7]: https://github.com/gdsfactory/kfactory/compare/v0.20.6...v0.20.7
[v0.20.6]: https://github.com/gdsfactory/kfactory/compare/v0.20.5...v0.20.6
Expand Down
42 changes: 42 additions & 0 deletions src/kfactory/kcell.py
Original file line number Diff line number Diff line change
Expand Up @@ -1373,6 +1373,48 @@ def __iter__(self) -> Iterator[Port]:
for p in self.cell_ports
)

def each_by_array_coord(self) -> Iterator[tuple[int, int, Port]]:
if not self.instance.is_regular_array():
if not self.instance.is_complex():
yield from (
(0, 0, p.copy(self.instance.trans)) for p in self.cell_ports
)
else:
yield from (
(0, 0, p.copy(self.instance.dcplx_trans)) for p in self.cell_ports
)
else:
if not self.instance.is_complex():
yield from (
(
i_a,
i_b,
p.copy(
kdb.Trans(self.instance.a * i_a + self.instance.b * i_b)
* self.instance.trans
),
)
for i_a in range(self.instance.na)
for i_b in range(self.instance.nb)
for p in self.cell_ports
)
else:
yield from (
(
i_a,
i_b,
p.copy(
kdb.DCplxTrans(
self.instance.da * i_a + self.instance.db * i_b
)
* self.instance.dcplx_trans
),
)
for i_a in range(self.instance.na)
for i_b in range(self.instance.nb)
for p in self.cell_ports
)

def __repr__(self) -> str:
"""String representation.
Expand Down

0 comments on commit 5bdc6b1

Please sign in to comment.