weldx icon indicating copy to clipboard operation
weldx copied to clipboard

Schema updates for current and upcoming asdf changes

Open braingram opened this issue 1 year ago • 5 comments

Changes

asdf is working on making the current development version of the ASDF standard (1.6.0) stable (see https://github.com/asdf-format/asdf/pull/1744 for details). As the 1.6.0 version contains new versions of a few core schemas (including ndarray). This PR updates the weldx schemas for these upcoming changes (and applies a few other related fixes).

  • update schema examples that use ndarray-1.0.0 adding a asdf-standard requirement to force these examples to use ASDF standard 1.5.0 (where ndarray-1.0.0 exists)
  • update schema "id"s to match "uri"s used to register the schemas with asdf
  • update manifest generation script to use the uri prefix used to register the manifests (see below)

For the manifests, the id in the files follow the form .../weldx/manifests/... https://github.com/BAMWelDX/weldx/blob/2bceb68405385229190cb00bb71dec95e941bed9/weldx/manifests/weldx-0.1.2.yaml#L3 However these files are registered: https://github.com/BAMWelDX/weldx/blob/2bceb68405385229190cb00bb71dec95e941bed9/weldx/asdf/extension.py#L27-L33 using the WELDX_EXTENSION_URI_BASE uri prefix: https://github.com/BAMWelDX/weldx/blob/2bceb68405385229190cb00bb71dec95e941bed9/weldx/asdf/constants.py#L9 which uses .../weldx/extensions. This means that these manifest resources are available (via the asdf resource_manager) using ../weldx/extensions/... uris yet have ids with .../weldx/manifests/

>> import asdf
>> manifest = asdf.schema.load_schema("asdf://weldx.bam.de/weldx/extensions/weldx-0.1.2")
>> manifest['id']
asdf://weldx.bam.de/weldx/manifests/weldx-0.1.2

This PR changes the ids to match the uris.

This PR also updates SerializationContext imports to use asdf.extension for asdf version >= 3.0.0 to avoid DeprecationWarning messages form importing asdf.asdf and SerializationContext from asdf.asdf.

Related Issues

Fixes #900

Checks

  • [ ] updated CHANGELOG.md
  • [ ] updated tests/
  • [ ] updated doc/
  • [ ] update example/tutorial notebooks
  • [ ] update manifest file

braingram avatar Feb 02 '24 17:02 braingram