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

inspect asdf_standard resources to find supported versions #1702

Closed
wants to merge 1 commit into from

Conversation

braingram
Copy link
Contributor

@braingram braingram commented Dec 12, 2023

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 the asdf-standard package and support all versions that have a version-map file. This should allow asdf-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:

  • update asdf-standard with the new version (breaking asdf tests)
  • release asdf-standard (and/or add conditional logic in asdf)
  • update asdf to support the new version and increase the asdf-standard lower pin
  • (hopefully remember to remove the now unneeded conditional logic)

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:

  • pre-commit checks ran successfully
  • tests ran successfully
  • for a public change, a changelog entry was added
  • for a public change, documentation was updated
  • for any new features, unit tests were added

@eslavich
Copy link
Contributor

Should have done this a long time ago!

Copy link
Contributor

@eslavich eslavich left a 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():
Copy link
Contributor

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.

Copy link
Contributor Author

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:

fd.write(self.version_map["FILE_FORMAT"].encode("ascii"))

and yaml versIon:
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.

@braingram
Copy link
Contributor Author

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".

@braingram braingram closed this May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants