Conversation
Reviewer's GuideUpdates regression test infrastructure and fixtures to include explicit port data, improves GDS difftest UX with visual XOR outputs and an update flag, exposes new ring configuration options, and enhances CI release workflow and Makefile targets to better manage labeling and GDS reference updates. Sequence diagram for updated ring_single bend resolutionsequenceDiagram
actor Designer
participant ring_single_cband
participant gf_get_component
participant gf_c_ring_single
Designer->>ring_single_cband: call ring_single(gap, radius, length_x, length_y, cross_section, bend, p)
ring_single_cband->>gf_get_component: get_component(bend, p, radius, cross_section)
gf_get_component-->>ring_single_cband: bend_component
ring_single_cband->>gf_c_ring_single: ring_single(gap, radius, length_x, length_y, bend_component, straight, coupler_ring, cross_section, length_extension)
gf_c_ring_single-->>Designer: ring_component
Flow diagram for updated Makefile test and GDS update workflowflowchart LR
dev[Developer]
make_test[Run make test]
make_test_ports[Run make test-ports]
make_test_force[Run make test-force]
pytest_all[pytest selected test suites]
pytest_ports[pytest optical_port_positions tests]
pytest_force[pytest with --update-gds-refs --force-regen]
gds_refs[GDS reference files updated]
dev --> make_test
dev --> make_test_ports
dev --> make_test_force
make_test --> pytest_all
make_test_ports --> pytest_ports
make_test_force --> pytest_force
pytest_force --> gds_refs
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 1 issue, and left some high level feedback:
- In both si220 ring_single wrappers, passing
bend=gf.get_component(...)intogf.c.ring_singlechanges the API from a ComponentSpec/name to a concrete Component instance; if gdsfactory expects a spec here, this should instead pass the bend spec/parameters, not a pre-instantiated component. - The removal of the explicit zero-length (length_x/length_y == 0) handling in ring_single means you now fully rely on gf.c.ring_single for those edge cases; if zero-length straights previously avoided port overlap issues, consider verifying that gf.c.ring_single handles these geometries equivalently or restoring a lightweight guard.
- The custom difftest in tests/conftest.py still prompts via input() when
--update-gds-refsis set, which is not suitable for automated CI runs; consider making update behavior fully non-interactive (e.g., always update or controlled by an additional flag) and avoiding klayout-based GUI calls in headless environments.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In both si220 ring_single wrappers, passing `bend=gf.get_component(...)` into `gf.c.ring_single` changes the API from a ComponentSpec/name to a concrete Component instance; if gdsfactory expects a spec here, this should instead pass the bend spec/parameters, not a pre-instantiated component.
- The removal of the explicit zero-length (length_x/length_y == 0) handling in ring_single means you now fully rely on gf.c.ring_single for those edge cases; if zero-length straights previously avoided port overlap issues, consider verifying that gf.c.ring_single handles these geometries equivalently or restoring a lightweight guard.
- The custom difftest in tests/conftest.py still prompts via input() when `--update-gds-refs` is set, which is not suitable for automated CI runs; consider making update behavior fully non-interactive (e.g., always update or controlled by an additional flag) and avoiding klayout-based GUI calls in headless environments.
## Individual Comments
### Comment 1
<location path="tests/conftest.py" line_range="43-52" />
<code_context>
+def difftest( # noqa: C901
</code_context>
<issue_to_address>
**issue (bug_risk):** The custom `difftest` helper is interactive when `--update-gds-refs` is used, which can make automated runs non-deterministic.
Within the `if _config["update_gds_refs"]:` branch, `difftest` calls `input()` to confirm updates, which can hang or behave unpredictably in non-interactive contexts (CI, pre-commit, etc.). Consider either making `--update-gds-refs` non-interactive (always update) and adding a separate flag for interactive review, or failing fast with a clear error when used in a non-interactive environment. This will keep behavior deterministic for automated pipelines.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| def difftest( # noqa: C901 | ||
| component: gf.Component, | ||
| test_name: str | None = None, | ||
| dirpath: pathlib.Path = pathlib.Path.cwd(), # noqa: B008 | ||
| xor: bool = True, | ||
| dirpath_run: pathlib.Path | None = None, | ||
| ignore_sliver_differences: bool | None = None, | ||
| sliver_tolerance: int = 1, | ||
| ) -> None: | ||
| """Custom difftest that saves XOR diff images on failure instead of prompting.""" |
There was a problem hiding this comment.
issue (bug_risk): The custom difftest helper is interactive when --update-gds-refs is used, which can make automated runs non-deterministic.
Within the if _config["update_gds_refs"]: branch, difftest calls input() to confirm updates, which can hang or behave unpredictably in non-interactive contexts (CI, pre-commit, etc.). Consider either making --update-gds-refs non-interactive (always update) and adding a separate flag for interactive review, or failing fast with a clear error when used in a non-interactive environment. This will keep behavior deterministic for automated pipelines.
Summary by Sourcery
Update ring cell APIs to support configurable bend components while enriching test coverage and infrastructure for port-aware regression testing and GDS XOR visualization.
New Features:
Enhancements:
CI:
Tests:
Chores: