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

ModelArraySlice and slicing infrastructure #736

Open
wants to merge 63 commits into
base: develop
Choose a base branch
from
Open

Conversation

timspainNERSC
Copy link
Collaborator

@timspainNERSC timspainNERSC commented Nov 18, 2024

ModelArraySlice and slicing infrastructure

Fixes #735

Change Description

Adds a class to allow slicing ModelArrays in order to use part of the data within. Also includes the ArraySlicer::Slice class that provides the slicing syntax and an iterator class for accessing data.


Test Description

Several test cases that check that the slicing syntax is correctly interpreted and that making reasonable slices produces expected results. To fully test the slice syntax, a comprehensive suite of cases is defined. As far as possible, the class is designed to behave like the numpy Python library.


Documentation Impact

A section will need to be added to the eventual ModelArray developer documentation. As this does not yet exist, there is nothing to add as part of this PR.

@TomMelt
Copy link
Contributor

TomMelt commented Nov 19, 2024

just mentioning for future reference... If we move to c++23 we may wish to consider using mdspans. This would allow us to easily switch between 1D and N-D array views.

@timspainNERSC timspainNERSC marked this pull request as ready for review November 27, 2024 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Review required
Development

Successfully merging this pull request may close these issues.

Slice ModelArrays
2 participants