-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
GH-38415: [MATLAB] Add indexing "slice" method to C++ Array Proxy class #38674
Merged
Conversation
This file contains 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
kevingurney
approved these changes
Nov 13, 2023
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.
Thanks for working on this!
+1 |
After merging your PR, Conbench analyzed the 4 benchmarking runs that have been run so far on merge-commit e18ace3. There were no benchmark performance regressions. 🎉 The full Conbench report has more details. |
loicalleyne
pushed a commit
to loicalleyne/arrow
that referenced
this pull request
Nov 13, 2023
…xy class (apache#38674) ### Rationale for this change In order to support MATLAB indexing semantics on the `arrow.array.Array` classes, we first need to add a method for "slicing" an Arrow Array to the C++ Array Proxy classes. ### What changes are included in this PR? 1. Added a `slice` method to the C++ Arrow Array Proxy class. 2. Added a `slice` method to `arrow.array.Array`. This method invokes the `slice` method on the proxy class. **Example** ```matlab >> a = arrow.array([1 2 NaN 4 5 NaN 7]) a = Float64Array with 7 elements and 2 null values: 1 | 2 | null | 4 | 5 | null | 7 % Note: MATLAB uses 1-based indexing. >> slice = a.slice(int64(2), int64(4)) slice = Float64Array with 4 elements and 1 null value: 2 | null | 4 | 5 ``` ### Are these changes tested? Yes, added a new test file called `tSlice.m`. ### Are there any user-facing changes? The `slice` method is public, but [hidden](https://www.mathworks.com/help/matlab/matlab_oop/method-attributes.html). * Closes: apache#38415 Authored-by: Sarah Gilmore <sgilmore@mathworks.com> Signed-off-by: Kevin Gurney <kgurney@mathworks.com>
dgreiss
pushed a commit
to dgreiss/arrow
that referenced
this pull request
Feb 19, 2024
…xy class (apache#38674) ### Rationale for this change In order to support MATLAB indexing semantics on the `arrow.array.Array` classes, we first need to add a method for "slicing" an Arrow Array to the C++ Array Proxy classes. ### What changes are included in this PR? 1. Added a `slice` method to the C++ Arrow Array Proxy class. 2. Added a `slice` method to `arrow.array.Array`. This method invokes the `slice` method on the proxy class. **Example** ```matlab >> a = arrow.array([1 2 NaN 4 5 NaN 7]) a = Float64Array with 7 elements and 2 null values: 1 | 2 | null | 4 | 5 | null | 7 % Note: MATLAB uses 1-based indexing. >> slice = a.slice(int64(2), int64(4)) slice = Float64Array with 4 elements and 1 null value: 2 | null | 4 | 5 ``` ### Are these changes tested? Yes, added a new test file called `tSlice.m`. ### Are there any user-facing changes? The `slice` method is public, but [hidden](https://www.mathworks.com/help/matlab/matlab_oop/method-attributes.html). * Closes: apache#38415 Authored-by: Sarah Gilmore <sgilmore@mathworks.com> Signed-off-by: Kevin Gurney <kgurney@mathworks.com>
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.
Rationale for this change
In order to support MATLAB indexing semantics on the
arrow.array.Array
classes, we first need to add a method for "slicing" an Arrow Array to the C++ Array Proxy classes.What changes are included in this PR?
slice
method to the C++ Arrow Array Proxy class.slice
method toarrow.array.Array
. This method invokes theslice
method on the proxy class.Example
Are these changes tested?
Yes, added a new test file called
tSlice.m
.Are there any user-facing changes?
The
slice
method is public, but hidden.Array
Proxy class #38415