Skip to content

backend/gds: Normalize angles upon export#203

Merged
gpeairs merged 1 commit intoaws-cqc:mainfrom
gjnorris-cqc:gjnorris/add-gds-rotation-normalization
Apr 16, 2026
Merged

backend/gds: Normalize angles upon export#203
gpeairs merged 1 commit intoaws-cqc:mainfrom
gjnorris-cqc:gjnorris/add-gds-rotation-normalization

Conversation

@gjnorris-cqc
Copy link
Copy Markdown
Contributor

During routing, angles can accumulate, resulting in values which are outside the GDS spec of [-360, 360]. This results in warnings from tools like Klayout.

This PR adds an option to warn about invalid angles during export (on by default) and to normalize the angles (off by default).

@gjnorris-cqc gjnorris-cqc force-pushed the gjnorris/add-gds-rotation-normalization branch from 3016b9c to 47dc7fb Compare April 15, 2026 21:48
@gpeairs
Copy link
Copy Markdown
Member

gpeairs commented Apr 16, 2026

I think it’s fine to normalize unconditionally and silently, it costs almost nothing and I can’t think of a reason the user would want to track the difference between 180 and 540. So I suggest

  • Remove the options and associated logic
  • Add a roundtrip test where you save and load a GDS with a rotation that gets normalized (can go with the others here
    # Round-trip tests
    )

@gjnorris-cqc gjnorris-cqc force-pushed the gjnorris/add-gds-rotation-normalization branch from 47dc7fb to f2f343b Compare April 16, 2026 17:08
@gjnorris-cqc gjnorris-cqc changed the title backend/gds: Add invalid angle warning and angle normalization option backend/gds: Normalize angles upon export Apr 16, 2026
@gjnorris-cqc
Copy link
Copy Markdown
Contributor Author

Thanks for the feedback. I have implemented your suggested changes in the latest version.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown
Member

@gpeairs gpeairs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@gpeairs gpeairs merged commit a0d0f70 into aws-cqc:main Apr 16, 2026
7 checks passed
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

Successfully merging this pull request may close these issues.

2 participants