Basic serialization support for GWCS extensions#166
Merged
embray merged 3 commits intoasdf-format:mainfrom Mar 25, 2026
Merged
Conversation
terms of LoC) way to create a new YAML sequence for an array of C native types This should be expanded to the extension API as well, but for now it's most useful for basic scalar types. feat: initial support for serialization of the existing supported GWCS extension types asdf-formatgh-138
during serialization of objects that embed ndarrays still a bit of a workaround but I think it's fairly useful; the temporary array allocation is only needed during serialization for write, and can be freed after a successful write. This eliminates leaking mmaps from before. The write-callback mechanism could be useful for some other things too. I may add more callback mechanisms in the future; for now it's just an internal feature though. asdf-formatgh-138
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Of the ones that have been implemented so far.
Getting this right is a bit tricky because if you have something that serializes to an ndarray, you have to build that ndarray object on the fly and then serialize it. But then when you allocate memory for the ndarray data something needs to clean that up later once writing is complete and the blocks have been serialized (though this might be less of an issue for inline data, which is still to be implemented).
For now the workaround is to add post-write cleanup callbacks.
Resolves #138