Adding multiple tag version support in extension registration#224
Open
embray wants to merge 8 commits into
Open
Adding multiple tag version support in extension registration#224embray wants to merge 8 commits into
embray wants to merge 8 commits into
Conversation
This changes ASDF_REGISTER_EXTENSION in two ways. One or more tags can be passed in, now as its trailing arguments with varargs support. Another significant change to help support this is that `asdf_extension_t` is refactored to move all extension methods into a separate `asdf_extension_vtab_t` to which `asdf_extension_t` holds a pointer. This will make it easier to extend `asdf_extension_vtab_t` in the future without major ABI breakage, and it also simplifies the call signature for `ASDF_REGISTER_EXTENSION` (a similar change earlier was to remove the individual `asdf_software_t` fields from `ASDF_REGISTER_EXTENSION`'s call signature). The decision was made for not *not* to support tag wildcards in the extension registry; this is in line with the reasoning behind asdf-format/asdf#1049 ; This might be worth revisiting to make extensions more flexible to support wider ranges of tag versions without requiring a software update, but I think that will first take some more careful formalization of how tag versions are actually used by ASDF...
The main difference in 1.1.0 is addition of the float16 type (now supported since asdf-formatgh-14), so in order to try out doing something interesting with different tag versions, parse the ndarray tag version to check for float16 support. For now opted to keep things flexible and allow it even if the ndarray is tagged 1.0.0, but log a warning. refactor: add ARRAY_SIZE macro asdf-formatgh-42
(The sense of these ifdef blocks was inversed)
and multiple tag handling explained. Add changelog entry.
This was referenced Jul 9, 2026
With asdf-formatgh-42 basically done it made sense finally to add this and see how far we could get ( this was originally asdf-formatgh-155 ). To my amazement every file works except a couple expected exceptions; only needed to add the asdf-1.0.0 tag.
The author and homepage properties are optional; it's fine if they're missing--the warning log only applies if it's the wrong type (not a string)
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.
Description
Implements #42 with one caveat: I decided to omit support for wildcards for now. This actually turns out to be even more of a can of worms than I thought, and the discussion in asdf-format/asdf#1048 provides a good rationale against them, and is the reason Python asdf also dropped support for this in its Converters for now. I think there might still be a way to support this sensibly but it requires more careful consideration.
Also adds #155 which I almost forgot there was an issue for. Since this overcomes the small existing hurdle to reading some of the older reference files, I wanted to add such a test as a smoke test for what other tag versions might need to be added (not many it turns out, at least for the existing supported core tags).
AI Disclosure
No AI tools used.