Skip to content
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

Pdarray indexing #3093

Merged
merged 17 commits into from
Apr 11, 2024
Merged

Conversation

jeremiah-corrado
Copy link
Contributor

@jeremiah-corrado jeremiah-corrado commented Apr 10, 2024

Implement multidimensional pdarray indexing.

For example, the following indexing patterns now match numpy's behavior, where A is a 3D pdarray and a is a 1D pdarray:

x = A[a, a, a]
x = A[a, a, 1]
x = A[a, a, :]
x = A[a, 1, 1]
x = A[a, :, 1]
x = A[a, ...]

Also implements rank expansion via 'None' indices. For example, the following would return a 4D array, where the 3rd dimension has a size of 1:

x = A[1, :, None, a]

*also fixes a bug in unstackMsg

jeremiah-corrado and others added 12 commits March 20, 2024 16:32
…ions module. Implement rank-reducing indexing for ND arrays. Bug fixes and performance improvements in manipultation functions.

Signed-off-by: Jeremiah Corrado <[email protected]>
…rank would be exceeded

Signed-off-by: Jeremiah Corrado <[email protected]>
Copy link
Contributor

@bmcdonald3 bmcdonald3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, couple of questions.

src/IndexingMsg.chpl Outdated Show resolved Hide resolved
src/ManipulationMsg.chpl Show resolved Hide resolved
@bmcdonald3 bmcdonald3 added this pull request to the merge queue Apr 11, 2024
Merged via the queue into Bears-R-Us:master with commit 1d8bf65 Apr 11, 2024
13 checks passed
@jeremiah-corrado jeremiah-corrado deleted the pdarray-indexing branch April 11, 2024 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants