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

Deprecate broadcasting. #934

Closed
1uc opened this issue Feb 2, 2024 · 2 comments
Closed

Deprecate broadcasting. #934

1uc opened this issue Feb 2, 2024 · 2 comments
Labels
v3 Anything that needs to be resolved before `v3`.

Comments

@1uc
Copy link
Collaborator

1uc commented Feb 2, 2024

HighFive has a feature that allows reading an array with leading (or trailing) singleton dimensions into an array with lower dimension, i.e. if the selection is {1, 3} we can read this into anything one-dimensional, such as an std::vector<double>.

It's currently one of the reasons we need to know the dimension of a container at compile time. The proposal is to drop the feature from v3 and replace it with the explicit ability to reshape a selection. Something similar to:

count = {1, 12};
dset.select(RegularHyperSlab(offset, count))
    .reshapeMemSpace({count[1]})
    .read<std::vector<double>>();

The advantage is that we don't internally change the rank of an array. We avoid the need to know at compile-time the rank of an array. It can work even if one wants to strip from both sides. It would also work for HyperSlabs since for them the resulting selection could be any subregion, we currently only allow reading those selection into one-dimensional arrays. If the user knows it's two-dimensional they can provide the dimensions by using a different overload. It should works symmetrically on reading and writing. I feel it has rather low mental cost / complexity.

@1uc 1uc added the v3 Anything that needs to be resolved before `v3`. label Feb 2, 2024
@alkino
Copy link
Member

alkino commented Feb 5, 2024

Yes of course. This feature is a pain to fix the auto-magic support of a lot of types.

@1uc
Copy link
Collaborator Author

1uc commented May 14, 2024

Removed by #992.

@1uc 1uc closed this as completed May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v3 Anything that needs to be resolved before `v3`.
Projects
None yet
Development

No branches or pull requests

2 participants