Skip to content

Basic serialization support for GWCS extensions#166

Merged
embray merged 3 commits intoasdf-format:mainfrom
embray:issue-138
Mar 25, 2026
Merged

Basic serialization support for GWCS extensions#166
embray merged 3 commits intoasdf-format:mainfrom
embray:issue-138

Conversation

@embray
Copy link
Copy Markdown
Collaborator

@embray embray commented Mar 24, 2026

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

embray added 3 commits March 24, 2026 17:56
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
@embray embray merged commit 4bd6325 into asdf-format:main Mar 25, 2026
12 checks passed
@embray embray deleted the issue-138 branch March 25, 2026 11:00
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.

Write serializers for gwcs extensions

1 participant