Registry / serialization / asdf-transform-schemas

asdf-transform-schemas

JSON →
library0.6.0pypypiunverified

asdf-transform-schemas provides ASDF (Advanced Scientific Data Format) schemas primarily for validating transform tags, specifically those related to serializing `astropy.modeling` models into ASDF files. It acts as a dependency for higher-level packages like `asdf-astropy`, which implement the serialization logic. The library is currently at version 0.6.0 and generally follows the release cadence of the broader ASDF Standard.

pip install asdf-transform-schemas
INSTALL
IMPORT
SIG · ASDF-TRANSFORM-SCH
A
asdf-transform-schemas
serializationpythonv0.6.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

This quickstart demonstrates how `asdf-transform-schemas` facilitates the serialization and deserialization of `astropy.modeling` objects within ASDF files. While `asdf-transform-schemas` provides the schema definitions, the actual Python object handling is performed by the `asdf` library using the `asdf-astropy` extension. The example creates a `Rotation2D` model, saves it to an ASDF file, and then reads it back, implicitly using the schemas for validation.

import asdf from astropy.modeling.models import Rotation2D import os # Create an Astropy model rot_model = Rotation2D(angle=45) # Save the model to an ASDF file (asdf-astropy extension handles serialization) afd = asdf.AsdfFile({'rotation_transform': rot_model}) file_path = 'rotation_transform.asdf' afd.write_to(file_path) print(f"ASDF file '{file_path}' created successfully.") # Read the ASDF file back with asdf.open(file_path) as afd_read: read_model = afd_read['rotation_transform'] print(f"Read model: {read_model}") print(f"Angle of read model: {read_model.angle.value}") # Clean up os.remove(file_path)
Debug
Known issues
gotchaThis package primarily provides ASDF schema definition files and does not expose a significant Python API for direct user interaction. To utilize these schemas for serializing and deserializing `astropy.modeling` objects, you must install `asdf-astropy`.
fix
Install `asdf-astropy` (`pip install asdf-astropy`) and use the `asdf` library to work with files containing transform tags.
affects: All versions
breakingVersion 0.2.1 of `asdf-transform-schemas` was yanked from PyPI due to a breaking change affecting JWST (James Webb Space Telescope) data processing. Users encountering issues with this specific version should upgrade to a later, stable release.
fix
Avoid `0.2.1`. Upgrade to `asdf-transform-schemas` version `0.2.2` or later.
affects: 0.2.1
gotchaOlder versions of ASDF (the core library) experienced compatibility issues with `jsonschema` version `4.10.0`, leading to `AttributeError` or `DeprecationWarning` regarding missing metaschemas during validation. While `asdf-transform-schemas` is not directly the cause, it relies on `asdf`'s validation mechanisms.
fix
Ensure `jsonschema` is pinned to a compatible version (e.g., `<4.10.0` for older ASDF installations) or upgrade `asdf` and its extensions to recent versions that have resolved these compatibility issues.
affects: asdf < 2.9 (and earlier versions of asdf-transform-schemas and asdf-astropy)
breakingThe broader ASDF ecosystem, including `asdf-standard` versions (which influence schemas), has been dropping support for older Python versions. For instance, `asdf-standard` 1.5.0 (released Feb 2026) dropped Python 3.9 support. Ensure your Python environment meets the minimum requirements of all `asdf` related packages.
fix
Upgrade Python to a supported version (currently >=3.9 for `asdf-transform-schemas 0.6.0`, but check `asdf-standard` and `asdf` for their latest requirements).
affects: asdf-standard >= 1.5.0, asdf-transform-schemas >= 0.6.0
Errors
Common errors & fixes
AttributeError: 'list' object has no attribute 'get'
This error, often accompanied by 'The metaschema specified by $schema was not found', occurred in ASDF when `jsonschema` version 4.10.0 was installed. It indicates a compatibility breakdown in schema validation.
fix
Downgrade `jsonschema` to a version prior to `4.10.0` (e.g., `pip install 'jsonschema<4.10.0'`) or upgrade your `asdf` core library and associated extensions to their latest versions, which typically include fixes for such incompatibilities.
asdf.exceptions.ValidationError: tag:stsci.edu:asdf/transform/rotation2d-1.0.0 is not a valid tag
This error means that the ASDF file contains a transform tag (e.g., `rotation2d-1.0.0`) that the current ASDF environment cannot validate. This usually happens if the `asdf-astropy` extension, which registers these transform schemas, is not installed or not correctly loaded.
fix
Ensure `asdf-astropy` is installed (`pip install asdf-astropy`). If it is, verify that it's properly registered with ASDF, which usually happens automatically on import, or by restarting your Python environment. Also, check the version compatibility between `asdf`, `asdf-astropy`, and the ASDF Standard version used in the file.
Upgrade
Version history
0.6.0latest on PyPI · released May 27, 2025
Audit
Dependencies
asdfrequiredCore ASDF library for file handling.
asdf-astropyrequiredRequired to serialize/deserialize Astropy models using these schemas.
astropyrequiredProvides the modeling classes that these schemas validate.
Agent activity
28 hits · last 30 days
node
22
Amazon
1
OpenAI (training)
1
Resources