This repository was archived by the owner on Oct 19, 2026. It is now read-only.
Repository navigation
Fix origin-dependent AREF vector detection - #334
Merged
Merged
Conversation
heitzmann
approved these changes
Oct 15, 2026
Owner
|
@CAOShurong Could you please take a look at the test errors? They seem to be just a matter of fixing the tolerance. |
Contributor
Author
|
Updated both vector checks to use the same coordinate-derived absolute tolerance as the offsets ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #299 and ecf9675.
The AREF XY record stores three absolute points. The rectangular-array check
currently compares two cross coordinates with zero, so classification changes
when the same array is translated. For example, translating the file attached
to #299 makes its four instances overlap: offsets
(0, 50, 100, 150)become(0, 0, 0, 0).Compare those coordinates with the corresponding origin coordinates instead.
This preserves the existing vector calculation and rotation/reflection handling;
raw integer equality also avoids subtraction overflow.
The synthetic regression covers rectangular, swapped, skewed, reversed and
zero vectors, translated origins, transforms, unit conversion and large legal
coordinates. It does not include the reporter's binary file.
Validation on Windows 11, CPython 3.13.1, MSVC:
The new regression has 14 failures / 52 passes on main and passes all 66
cases repeatedly with the patch. All 91 original outcomes are unchanged;
the full suite passes 157 tests.
python -m pytest <checkout>/tests/library_test.py -k aref_vectors -qand
python -m pytest <checkout>/tests -qoutside the source package, withfresh explicit
--basetempdirectories.installed API, plus GDS/OAS/streaming/flattened round-trips. KLayout 0.30.12
independently compares polygon geometry for 68 inputs across four routes.
the wheel/sdist and checked source/package/installed bytes.
Whole-file Black retains one pre-existing formatting difference; compiler
warnings match unmodified main.
Linux/macOS, other Python versions and production EDA signoff were not run
locally. No writer, tolerance or public API changes are included.