Repository navigation
Add tests to confirm: proper de-duplication across -180/180 and 0/360 lon wraps - #1903
Merged
Merged
Conversation
regression test for #1039. (Not enough context to know if this was definitely the original issue, but it might have been one of them / seems related, at least?)
cmdupuis3
approved these changes
Nov 16, 2026
erogluorhan
approved these changes
Nov 17, 2026
erogluorhan
left a comment
Member
There was a problem hiding this comment.
Closing #1039 with this test looks right to me: the duplicates it describes are no longer produced, and the test pins that down.
- The new test passes on the PR. Run against the commit before #1692 (
d6adb4e9^), it fails withn_edge6 instead of 5, so it does guard the fix. - The merge compares nodes in xyz, so any longitudes equal mod 360 are merged, not only 0/360 and ±180.
-45/315also gives 5 edges. - The same two-triangle grids, written to a file and opened with
ux.open_grid(path, chunks=-1), also give 5 edges and the rightface_face_connectivity. That covers the lazy path, which skips the merge at construction. - The case from the linked #1147 comment (HEALPix corners at 0/360) is also fixed:
from_healpix(zoom=0..2)has no duplicate nodes, andn_edge == n_face + n_node - 2(Euler's formula).test_healpix.py::test_boundariesalready checks this throughn_node == n_face + 2.
Requested before merge: nothing, once CI is green.
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #1039
Overview
This PR adds
test_duplicate_nodes_across_lon_wrapswhich ensures the de-duplication routines introduced by #1692 properly handle duplicates which are at different numerical values but equivalent mod 360. In particular it ensures lon=0 and lon=360 are recognized as equivalent, and that lon=-180 and lon=180 are recognized as equivalent.The underlying issue (#1039) has basically no context; it links one comment with a minimal example in a separate PR but that example was fixed to be handled properly within that PR already (and I locally confirmed that it remains solved today). I can only guess at what the issue might have been referring to, and recently there have been various fixes to de-duplication and lon wrapping (such as #1692, #1690, #1525), so I get the impression that there is a decent chance the underlying issue which led to this 2+ year-old report has likely already been solved.
Rather than just mark the issue as closed, I'm proposing that maybe a minimal reproducer for it could have looked something like this:
This is covered by the new test, and was solved recently, via #1692.
(Pointing Claude at this problem also didn't lead to discovering any obvious cases where a bug matching this description might still exist in the uxarray codebase.)
PR Checklist
General
Testing & Benchmarking
Documentation and Examples
docs/api.rst; internal (private) function names start with an underscore (_)AI Disclosure
AI Usage: Claude Opus 5.5, plus GitHub Copilot inline code suggestions