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

Pass dimensions to 'serialize'. #939

Merged
merged 1 commit into from
Feb 16, 2024
Merged

Pass dimensions to 'serialize'. #939

merged 1 commit into from
Feb 16, 2024

Conversation

1uc
Copy link
Collaborator

@1uc 1uc commented Feb 3, 2024

By passing the dimensions to serialize allows serializing nested pointers. This was previously not possible because, we didn't know how many elements the pointer pointed to.

The logic for obtaining the dimensions of the array is:

  • When creating/opening the array the memspace is set to be the same as the filespace.

  • Performing a selection either leads to a simple (packed) multi-dimensional memspace; or to a one-dimensional memspace.

Therefore, if we perform a write without selection, we know the dimensions the input array must have. If we perform a selection we again know the dimensions the input buffer needs to have.

@1uc 1uc added the v3 Anything that needs to be resolved before `v3`. label Feb 3, 2024
@1uc
Copy link
Collaborator Author

1uc commented Feb 3, 2024

Since it changes the inspector, we should probably not merge this into v2.

Copy link

codecov bot commented Feb 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (f32d186) 84.55% compared to head (c28af89) 84.55%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #939   +/-   ##
=======================================
  Coverage   84.55%   84.55%           
=======================================
  Files          86       86           
  Lines        5220     5220           
=======================================
  Hits         4414     4414           
  Misses        806      806           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@1uc 1uc marked this pull request as ready for review February 9, 2024 16:08
By passing the dimensions to `serialize` allows serializing nested
pointers. This was previously not possible because, we didn't know how
many elements the pointer pointed to.

The logic for obtaining the dimensions of the array is:

  * When creating/opening the array the memspace is set to be the same
    as the filespace.

  * Performing a selection either leads to a simple (packed)
    multi-dimensional memspace; or to a one-dimensional memspace.

Therefore, if we perform a write without selection, we know the
dimensions the input array must have. If we perform a selection we again
know the dimensions the input buffer needs to have.
@1uc 1uc merged commit a169b83 into master Feb 16, 2024
36 checks passed
@1uc 1uc deleted the 1uc/serialize-with-dims branch February 16, 2024 14:21
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

Successfully merging this pull request may close these issues.

3 participants