Skip to content

Add ArrayView and LocalView method extent(Int) as in mdspan#390

Merged
wdeconinck merged 1 commit into
developfrom
feature/arrayview_extent
Jun 16, 2026
Merged

Add ArrayView and LocalView method extent(Int) as in mdspan#390
wdeconinck merged 1 commit into
developfrom
feature/arrayview_extent

Conversation

@wdeconinck

@wdeconinck wdeconinck commented Jun 16, 2026

Copy link
Copy Markdown
Member

This pull request introduces a new convenience method, extent, to both the LocalView and ArrayView classes. The extent method is a simple alias for the existing shape method, providing a more intuitive way to query the size of a specific array dimension.

API enhancements for array views:

  • Added the extent(Int idx) method to LocalView, which returns the number of values in the specified dimension and is equivalent to calling shape(idx) (src/atlas/array/LocalView.h).
  • Added the extent(Int idx) method to ArrayView, also as an alias for shape(idx), improving consistency and usability (src/atlas/array/native/NativeArrayView.h).

💣💥☠️ Static Analyzer Report ☠️💥💣
https://sites.ecmwf.int/docs/atlas/static-analyzer/PR-390

@wdeconinck wdeconinck merged commit e85eef2 into develop Jun 16, 2026
218 checks passed
@wdeconinck wdeconinck deleted the feature/arrayview_extent branch June 16, 2026 15:03
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.

1 participant