-
Notifications
You must be signed in to change notification settings - Fork 58
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
inspect asdf_standard resources to find supported versions #1702
Conversation
689a78c
to
341ea2d
Compare
Should have done this a long time ago! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, I meant to approve before, but I must have hit the wrong button.
AsdfVersion("1.5.0"), | ||
AsdfVersion("1.6.0"), | ||
] | ||
def _find_asdf_standard_version_map_versions(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I recommend basing this off of the manifest files, since they were meant to replace version_map-*.yml.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking a look and for this recommendation. I'm going to spend some time looking into this but will put some immediate thoughts/questions below.
One difference between the version maps and manifests is that the version maps contain entries for the file format and yaml version (see https://github.com/spacetelescope/stdatamodels/pull/253/files). Are these defined (or do they need to be defined) in the manifests?
Looking at how version map is used it determines the file format version:
Line 918 in 7ae2d7e
fd.write(self.version_map["FILE_FORMAT"].encode("ascii")) |
and yaml versIon:
Line 399 in 7ae2d7e
yaml_version = tuple(int(x) for x in ctx.version_map["YAML_VERSION"].split(".")) |
used when writing the file.
During a (albeit quick) glance over the asdf-standard tests I don't see anything that checks that the version map and manifests agree :-/
As the changes in this PR assume the version map and manifests agree (in version) I will leave this PR as draft until the above can be sorted and the tests updated.
408a92f
to
a1af817
Compare
a1af817
to
2d1be2b
Compare
Closing as the required PR asdf-format/asdf-standard#415 was closed. It may be worth revisiting this in the future but at the moment this isn't ready for "prime time". |
Requires asdf-format/asdf-standard#416 (this is currently included in the CI to verify the sequence of fixes described in that PR work). This temporary change can be removed when the linked PR is merged.
This PR changes how asdf determines supported ASDF standard versions (the standard not the
asdf-standard
python package). With this PR asdf will inspect theasdf-standard
package and support all versions that have aversion-map
file. This should allowasdf-standard
to add new standards without breaking asdf (more on that below).Currently if a new standard were added that contains schema changes that shouldn't require asdf code changes one would need to:
With this PR the above new standard would require no changes in asdf. This will not be true for all ASDF standard versions as some may require changes to the converters/etc where some version of the above coordination might be required.
After this PR is merged asdf-format/asdf-standard#415 can be brought out of draft.
Checklist: