asdf-format / asdf

ASDF (Advanced Scientific Data Format) is a next generation interchange format for scientific data
http://asdf.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
523 stars 57 forks source link

Record manifest providing package in history, use specific warning for `_check_extensions` #1758

Closed braingram closed 5 months ago

braingram commented 7 months ago

Description

This PR adds the package name and version for the package providing the manifest used to create an extension that was used to write the file. For example, writing out a file with this PR produces a history:

history:
  extensions:
  - !core/extension_metadata-1.0.0
    extension_class: asdf.extension._manifest.ManifestExtension
    extension_uri: asdf://asdf-format.org/core/extensions/core-1.5.0
    manifest_software: !core/software-1.0.0 {name: asdf-standard, version: 1.0.4.dev153+gcafd84a}
    software: !core/software-1.0.0 {name: asdf, version: 3.0.2.dev81+g67e7a8e3.d20240205}

This will be beneficial for tracking what software was used for the many asdf extensions that use manifests from other packages (like gwcs and asdf-wcs-schemas, roman_datamodels and rad, etc...).

This new manifest_software is also checked during AsdfFile._check_extension.

Finally, the warning class used during _check_extension was changed from the generic AsdfWarning to a more specific AsdfPackageVersionWarning (which inherits from AsdfWarning).

Fixes #1740

Checklist: