-
Notifications
You must be signed in to change notification settings - Fork 1
Subgrid shift #33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Subgrid shift #33
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements subgrid shift functionality for Grid objects, allowing selective shifting of columns and rows while preserving grid integrity. The implementation adds methods to shift specific column or row indices by a given amount while automatically adjusting spacing to maintain grid structure.
- Adds
shift_subgrid_x
andshift_subgrid_y
methods with support for bothilist.IList
andslice
inputs - Implements validation to prevent invalid shifts that would change column/row ordering
- Includes comprehensive test coverage for various scenarios including edge cases
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
src/bloqade/geometry/dialects/grid/types.py | Core implementation of subgrid shift methods with spacing adjustment logic |
src/bloqade/geometry/dialects/grid/stmts.py | Statement definitions for the new shift operations |
src/bloqade/geometry/dialects/grid/concrete.py | Concrete interpreter implementations for subgrid shift statements |
src/bloqade/geometry/dialects/grid/_interface.py | Public API interface definitions with documentation |
src/bloqade/geometry/dialects/grid/init.py | Module exports for new shift operations |
test/grid/test_types.py | Comprehensive test cases covering various input types and edge cases |
test/grid/test_concrete.py | Integration tests for concrete interpreter functionality |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Args: | ||
grid (Grid): a grid object | ||
y_indices (float): a list/ilist of x indices to shift |
Copilot
AI
Oct 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Parameter description is incorrect. The parameter y_indices
should be described as 'a list/ilist of y indices to shift', not 'x indices'.
y_indices (float): a list/ilist of x indices to shift | |
y_indices (float): a list/ilist of y indices to shift |
Copilot uses AI. Check for mistakes.
Args: | ||
grid (Grid): a grid object | ||
x_indices (float): a list/ilist of x indices to shift |
Copilot
AI
Oct 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Parameter type annotation is incorrect. The parameter x_indices
should be described as having type ilist.IList[int, typing.Any]
, not float
.
x_indices (float): a list/ilist of x indices to shift | |
x_indices (ilist.IList[int, typing.Any]): a list/ilist of x indices to shift |
Copilot uses AI. Check for mistakes.
Args: | ||
grid (Grid): a grid object | ||
y_indices (float): a list/ilist of y indices to shift |
Copilot
AI
Oct 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Parameter type annotation is incorrect. The parameter y_indices
should be described as having type ilist.IList[int, typing.Any]
, not float
.
y_indices (float): a list/ilist of y indices to shift | |
y_indices (ilist.IList[int, typing.Any]): a list/ilist of y indices to shift |
Copilot uses AI. Check for mistakes.
subgrid_shift_x
andsubgrid_shift_y
as described in Shift subset of positions defined by a list of indices. #31ilist.IList
andslice
as input for column/row indices