{"id":7008,"library":"asdf-transform-schemas","title":"ASDF Transform Schemas","description":"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.","status":"active","version":"0.6.0","language":"en","source_language":"en","source_url":"https://github.com/asdf-format/asdf-transform-schemas","tags":["ASDF","schemas","astronomy","transforms","data format","astropy"],"install":[{"cmd":"pip install asdf-transform-schemas","lang":"bash","label":"Install library"},{"cmd":"pip install asdf-astropy astropy","lang":"bash","label":"Install to use schemas (recommended)"}],"dependencies":[{"reason":"Core ASDF library for file handling.","package":"asdf","optional":false},{"reason":"Required to serialize/deserialize Astropy models using these schemas.","package":"asdf-astropy","optional":false},{"reason":"Provides the modeling classes that these schemas validate.","package":"astropy","optional":false}],"imports":[],"quickstart":{"code":"import asdf\nfrom astropy.modeling.models import Rotation2D\nimport os\n\n# Create an Astropy model\nrot_model = Rotation2D(angle=45)\n\n# Save the model to an ASDF file (asdf-astropy extension handles serialization)\nafd = asdf.AsdfFile({'rotation_transform': rot_model})\nfile_path = 'rotation_transform.asdf'\nafd.write_to(file_path)\n\nprint(f\"ASDF file '{file_path}' created successfully.\")\n\n# Read the ASDF file back\nwith asdf.open(file_path) as afd_read:\n    read_model = afd_read['rotation_transform']\n    print(f\"Read model: {read_model}\")\n    print(f\"Angle of read model: {read_model.angle.value}\")\n\n# Clean up\nos.remove(file_path)","lang":"python","description":"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."},"warnings":[{"fix":"Install `asdf-astropy` (`pip install asdf-astropy`) and use the `asdf` library to work with files containing transform tags.","message":"This 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`.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Avoid `0.2.1`. Upgrade to `asdf-transform-schemas` version `0.2.2` or later.","message":"Version 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.","severity":"breaking","affected_versions":"0.2.1"},{"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.","message":"Older 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.","severity":"gotcha","affected_versions":"asdf < 2.9 (and earlier versions of asdf-transform-schemas and asdf-astropy)"},{"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).","message":"The 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.","severity":"breaking","affected_versions":"asdf-standard >= 1.5.0, asdf-transform-schemas >= 0.6.0"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"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.","cause":"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.","error":"AttributeError: 'list' object has no attribute 'get'"},{"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.","cause":"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.","error":"asdf.exceptions.ValidationError: tag:stsci.edu:asdf/transform/rotation2d-1.0.0 is not a valid tag"}]}