Handle non-monotonic 1D sweeps during gridding - #469
Merged
Merged
Conversation
Treat one-dimensional coordinates as acquisition-ordered lines while retaining monotonicity validation for multidimensional grids. Add synthetic regression coverage for a sweep that reverses direction. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 1261dd26-b267-46d3-8a6c-8dbca70f7641
astafan8
requested review from
jenshnielsen
and
a balanced review from Copilot
September 22, 2026 07:35
astafan8
marked this pull request as ready for review
September 22, 2026 07:35
astafan8
enabled auto-merge
September 22, 2026 07:35
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Explicit coverage for repeated coordinates is still missing.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Relaxes mesh validation for acquisition-ordered 1D sweeps while retaining multidimensional monotonicity checks.
Changes:
- Skips monotonicity validation for single-axis dependents.
- Adds regression coverage for reversed 1D sweeps.
| File | Description |
|---|---|
plottr/data/datadict.py |
Permits non-monotonic 1D coordinates. |
test/pytest/test_datadict_copy_semantics.py |
Tests reversed sweeps through both gridding paths. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 1261dd26-b267-46d3-8a6c-8dbca70f7641
astafan8
marked this pull request as draft
September 22, 2026 07:48
auto-merge was automatically disabled
September 22, 2026 07:48
Pull request was converted to draft
astafan8
marked this pull request as ready for review
September 22, 2026 07:50
astafan8
enabled auto-merge
September 22, 2026 07:51
jenshnielsen
approved these changes
Sep 22, 2026
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.

Summary
Context
Plottr already supports non-monotonic one-dimensional datasets when gridding is disabled: they can be plotted as acquisition-ordered lines without requiring their coordinate values to be monotonic.
The same datasets could still fail when shape metadata was present or when Plottr attempted to infer a grid shape. In those paths, conversion to
MeshgridDataDictapplied multidimensional monotonicity requirements to a one-dimensional coordinate and rejected otherwise plottable data.This change makes those paths user-friendly by allowing one-dimensional coordinates to reverse direction or repeat. The stricter monotonicity checks remain unchanged for multidimensional grids, where coordinate ordering is required to describe a valid mesh.
Testing
pytest -q test/pytest