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

Old (<2.14) versions of asdf do not fully support ASDF standard 1.6.0 #1776

Open
braingram opened this issue Mar 22, 2024 · 0 comments
Open

Comments

@braingram
Copy link
Contributor

ASDF standard 1.6.0 is nearing a stable point:
#1744
It is likely that no more schema changes will be made to the 1.6.0 standard. After downstream packages update, 1.6.0 can be enabled as the new default and no longer be marked as "development":

asdf_standard_development_version = AsdfVersion("1.6.0")

However, 1.6.0 contains a new ndarray schema version (and tag version):
https://github.com/asdf-format/asdf-standard/blob/main/resources/schemas/stsci.edu/asdf/core/ndarray-1.1.0.yaml

This creates an issue for asdf versions older than 2.14 as they have hard-coded support for only a single version (1.0.0):

class NDArrayType(AsdfType):
name = "core/ndarray"
version = "1.0.0"
types = [np.ndarray, ma.MaskedArray]

If a file was written using asdf < 2.14 and standard 1.6.0 was enabled. The file will have been produced with a ndarray-1.0.0 tag which is no longer readable (a AsdfConversionWarning and tagged representation will instead be returned).

This issue highlights some dangers to allowing asdf to produce files with "developement" standard versions with no warnings to the user that the file they are producing may at some point in the future be unreadable.

This issue documents the incompatibility. #1771 addresses the currently failing compatibility tests (which only revealed the issue after the asdf-standard release as they only use the released version of asdf-standard).

For any asdf users who might find this issue please reach out if you have difficulty reading files that were previously written with 1.6.0.

In the future the following may help to avoid re-occurance of this issue:

  • raise a UserWarning if a file is written with a development version (this can be caught and filtered in tests)
  • consider disabling the development version for non-development installs
  • run compatibility tests with the development version of asdf-standard to evaluate asdf-standard PRs
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

No branches or pull requests

1 participant