asdf
Advanced tools
| Metadata-Version: 2.4 | ||
| Name: asdf | ||
| Version: 4.4.0 | ||
| Version: 4.5.0 | ||
| Summary: Python implementation of the ASDF Standard | ||
@@ -91,4 +91,4 @@ Author-email: The ASDF Developers <help@stsci.edu> | ||
| next-generation interchange format for scientific data. This package | ||
| contains the Python implementation of the ASDF Standard. More | ||
| information on the ASDF Standard itself can be found | ||
| contains the Python implementation of the ASDF specification. More | ||
| information on the ASDF file format including the specification can be found | ||
| `here <https://asdf-standard.readthedocs.io>`__. | ||
@@ -407,3 +407,3 @@ | ||
| More information on the ASDF Standard itself can be found | ||
| More information on the ASDF file format itself can be found | ||
| `here <https://asdf-standard.readthedocs.io>`__. | ||
@@ -410,0 +410,0 @@ |
+9
-9
@@ -63,3 +63,3 @@ import copy | ||
| version : str, optional | ||
| The ASDF Standard version. If not provided, defaults to the | ||
| The ASDF core schemas version. If not provided, defaults to the | ||
| configured default version. See `asdf.config.AsdfConfig.default_version`. | ||
@@ -87,3 +87,3 @@ | ||
| files follow custom conventions beyond those enforced by the | ||
| standard. | ||
| specification. | ||
| """ | ||
@@ -149,3 +149,3 @@ # make a new AsdfVersion instance here so files don't share the same instance | ||
| """ | ||
| Get this AsdfFile's ASDF Standard version. | ||
| Get this AsdfFile's ASDF core schemas version. | ||
@@ -161,3 +161,3 @@ Returns | ||
| """ | ||
| Set this AsdfFile's ASDF Standard version. | ||
| Set this AsdfFile's ASDF core schemas version. | ||
@@ -178,3 +178,3 @@ Parameters | ||
| """ | ||
| Get this AsdfFile's ASDF Standard version as a string. | ||
| Get this AsdfFile's ASDF core schemas version as a string. | ||
@@ -322,3 +322,3 @@ Returns | ||
| Select installed extensions that are compatible with this | ||
| file's ASDF Standard version. | ||
| file's ASDF core schemas version. | ||
@@ -839,3 +839,3 @@ Returns | ||
| version : str, optional | ||
| Update the ASDF Standard version of this AsdfFile before | ||
| Update the ASDF core schemas version of this AsdfFile before | ||
| writing. | ||
@@ -988,3 +988,3 @@ """ | ||
| version : str, optional | ||
| Update the ASDF Standard version of this AsdfFile before | ||
| Update the ASDF core schemas version of this AsdfFile before | ||
| writing. | ||
@@ -1341,3 +1341,3 @@ """ | ||
| files follow custom conventions beyond those enforced by the | ||
| standard. | ||
| specification. | ||
@@ -1344,0 +1344,0 @@ strict_extension_check : bool, optional |
@@ -24,3 +24,3 @@ """ | ||
| The low-level ``io`` functions are responsible for reading and writing | ||
| bytes compatible with the block format defined in the ASDF standard. | ||
| bytes compatible with the block format defined in the ASDF specification. | ||
| These should be compatible with as wide a variety of file formats as possible | ||
@@ -27,0 +27,0 @@ including files that are: |
@@ -85,3 +85,3 @@ """ | ||
| # Revisit this if someone starts producing files without a | ||
| # YAML section, which the standard permits but is not possible | ||
| # YAML section, which the specification permits but is not possible | ||
| # with current software. | ||
@@ -330,3 +330,3 @@ reader = fd.reader_until( | ||
| """ | ||
| Extract the ASDF Standard version from YAML content. | ||
| Extract the ASDF core schemas version from YAML content. | ||
@@ -340,3 +340,3 @@ Parameters | ||
| asdf.versioning.AsdfVersion | ||
| ASDF Standard version | ||
| ASDF core schemas version | ||
| """ | ||
@@ -343,0 +343,0 @@ comments = _io.read_comment_section(generic_io.get_file(io.BytesIO(content))) |
+6
-6
@@ -33,3 +33,3 @@ from io import BytesIO | ||
| version : str, optional | ||
| Version of the ASDF Standard to use. If not specified, the default | ||
| Version of the ASDF core schemas to use. If not specified, the default | ||
| version will be used. | ||
@@ -57,3 +57,3 @@ | ||
| files follow custom conventions beyond those enforced by the | ||
| standard. | ||
| specification. | ||
| """ | ||
@@ -90,3 +90,3 @@ AsdfFile(tree, custom_schema=custom_schema, extensions=extensions).write_to( | ||
| version : str, optional | ||
| Version of the ASDF Standard to use. If not specified, the default | ||
| Version of the ASDF core schemas to use. If not specified, the default | ||
| version will be used. | ||
@@ -114,3 +114,3 @@ | ||
| files follow custom conventions beyond those enforced by the | ||
| standard. | ||
| specification. | ||
@@ -163,3 +163,3 @@ Returns | ||
| files follow custom conventions beyond those enforced by the | ||
| standard. | ||
| specification. | ||
@@ -210,3 +210,3 @@ Returns | ||
| files follow custom conventions beyond those enforced by the | ||
| standard. | ||
| specification. | ||
@@ -213,0 +213,0 @@ Returns |
@@ -6,3 +6,3 @@ from copy import copy, deepcopy | ||
| import asdf | ||
| from asdf.tagged import TaggedDict, TaggedList, TaggedString | ||
| from asdf.tagged import Tagged, TaggedDict, TaggedList, TaggedString, get_tag | ||
@@ -184,1 +184,42 @@ | ||
| asdf.schema.validate({"unit": unit}, schema=schema) | ||
| def _make_tagged_string(contents, tag): | ||
| obj = TaggedString(contents) | ||
| obj._tag = tag | ||
| return obj | ||
| def _make_custom_tagged(tag): | ||
| class CustomTagged(Tagged): | ||
| pass | ||
| obj = CustomTagged() | ||
| obj._tag = tag | ||
| return obj | ||
| def _make_custom_non_tagged(tag): | ||
| class CustomNonTagged: | ||
| pass | ||
| obj = CustomNonTagged() | ||
| obj._tag = tag | ||
| return obj | ||
| @pytest.mark.parametrize( | ||
| "obj, expected", | ||
| ( | ||
| (TaggedList([0, 1, 2], "tag:nowhere.org:custom/foo-1.0.0"), "tag:nowhere.org:custom/foo-1.0.0"), | ||
| (TaggedDict({"a": 1}, "tag:nowhere.org:custom/foo-1.0.0"), "tag:nowhere.org:custom/foo-1.0.0"), | ||
| (_make_tagged_string("a", "tag:nowhere.org:custom/foo-1.0.0"), "tag:nowhere.org:custom/foo-1.0.0"), | ||
| (_make_custom_tagged("tag:nowhere.org:custom/foo-1.0.0"), "tag:nowhere.org:custom/foo-1.0.0"), | ||
| (_make_custom_non_tagged("tag:nowhere.org:custom/foo-1.0.0"), None), | ||
| ), | ||
| ) | ||
| def test_get_tag(obj, expected): | ||
| """ | ||
| Test that get_tag returns the tag only for Tagged objects | ||
| """ | ||
| assert get_tag(obj) == expected |
+3
-3
@@ -31,5 +31,5 @@ # file generated by setuptools-scm | ||
| __version__ = version = '4.4.0' | ||
| __version_tuple__ = version_tuple = (4, 4, 0) | ||
| __version__ = version = '4.5.0' | ||
| __version_tuple__ = version_tuple = (4, 5, 0) | ||
| __commit_id__ = commit_id = 'g2df147c38' | ||
| __commit_id__ = commit_id = 'g3ab5f2ac2' |
+6
-6
@@ -227,3 +227,3 @@ """ | ||
| """ | ||
| Get the default ASDF Standard version used for | ||
| Get the default ASDF core schemas version used for | ||
| new files. | ||
@@ -240,3 +240,3 @@ | ||
| """ | ||
| Set the default ASDF Standard version used for | ||
| Set the default ASDF core schemas version used for | ||
| new files. | ||
@@ -282,6 +282,6 @@ | ||
| Get the configuration that controls filling defaults | ||
| from schemas for older ASDF Standard versions. If | ||
| from schemas for older ASDF core schemas versions. If | ||
| `True`, missing default values will be filled from the | ||
| schema when reading files from ASDF Standard <= 1.5.0. | ||
| Later versions of the standard do not support removing | ||
| schema when reading files from ASDF core schemas <= 1.5.0. | ||
| Later versions of the core schemas do not support removing | ||
| or filling schema defaults. | ||
@@ -299,3 +299,3 @@ | ||
| Set the flag that controls filling defaults from | ||
| schemas for older ASDF Standard versions. | ||
| schemas for older ASDF core schemas versions. | ||
@@ -302,0 +302,0 @@ Parameters |
+2
-2
@@ -287,3 +287,3 @@ import copy | ||
| if not self.schema: | ||
| tag = getattr(instance, "_tag", None) | ||
| tag = tagged.get_tag(instance) | ||
| if tag is not None and self.serialization_context.extension_manager.handles_tag_definition(tag): | ||
@@ -594,3 +594,3 @@ tag_def = self.serialization_context.extension_manager.get_tag_definition(tag) | ||
| Validate that mappings do not contain illegal key types | ||
| (as of ASDF Standard 1.6.0, only str, int, and bool are | ||
| (as of ASDF core schemas 1.6.0, only str, int, and bool are | ||
| permitted). | ||
@@ -597,0 +597,0 @@ """ |
+2
-0
@@ -151,2 +151,4 @@ """ | ||
| """ | ||
| if not isinstance(instance, Tagged): | ||
| return None | ||
| return getattr(instance, "_tag", None) |
@@ -8,3 +8,3 @@ from numbers import Integral | ||
| The ASDF Standard mandates that integer literals in the tree can be no | ||
| The ASDF specification mandates that integer literals in the tree can be no | ||
| larger than 64 bits. Use of this class enables the storage of arbitrarily | ||
@@ -11,0 +11,0 @@ large integer values. |
@@ -99,3 +99,3 @@ """ | ||
| # This is the ASDF Standard version that is currently in development | ||
| # This is the ASDF core schemas version that is currently in development | ||
| # it is possible that breaking changes will be made to this version. | ||
@@ -105,3 +105,3 @@ asdf_standard_development_version = AsdfVersion("1.7.0") | ||
| # This is the ASDF Standard version at which the format of the history | ||
| # This is the ASDF core schemas version at which the format of the history | ||
| # field changed to include extension metadata. | ||
@@ -111,3 +111,3 @@ NEW_HISTORY_FORMAT_MIN_VERSION = AsdfVersion("1.2.0") | ||
| # This is the ASDF Standard version at which we begin restricting | ||
| # This is the ASDF core schemas version at which we begin restricting | ||
| # mapping keys to string, integer, and boolean only. | ||
@@ -117,3 +117,3 @@ RESTRICTED_KEYS_MIN_VERSION = AsdfVersion("1.6.0") | ||
| # This library never removed defaults for ASDF Standard versions | ||
| # This library never removed defaults for ASDF core schemas versions | ||
| # later than 1.5.0, so filling them isn't necessary. | ||
@@ -120,0 +120,0 @@ FILL_DEFAULTS_MAX_VERSION = AsdfVersion("1.5.0") |
+27
-0
@@ -0,1 +1,28 @@ | ||
| 4.5.0 (2025-09-04) | ||
| ================== | ||
| Bugfix | ||
| ------ | ||
| - Fix bug in identification of tagged objects during schema validation and | ||
| using ``get_tag``. (`#1960 <https://github.com/asdf-format/asdf/pull/1960>`_) | ||
| Doc | ||
| --- | ||
| - Update references to "ASDF standard" to refer to either the specification or | ||
| core schemas to follow the new terminology used in the ASDF specification. | ||
| (`#1953 <https://github.com/asdf-format/asdf/pull/1953>`_) | ||
| - Update metaschemas description discouraging custom metaschemas. (`#1964 | ||
| <https://github.com/asdf-format/asdf/pull/1964>`_) | ||
| Removal | ||
| ------- | ||
| - Deprecate the bundled pytest plugin, please install pytest-asdf-plugin to run | ||
| schema tests. (`#1959 <https://github.com/asdf-format/asdf/pull/1959>`_) | ||
| 4.4.0 (2025-08-18) | ||
@@ -2,0 +29,0 @@ ================== |
@@ -169,3 +169,3 @@ .. currentmodule:: asdf | ||
| data from a device as it comes in to prevent data loss. The ASDF | ||
| Standard allows exactly one streaming block per file where the size of | ||
| specification allows exactly one streaming block per file where the size of | ||
| the block isn't included in the block header, but instead is | ||
@@ -172,0 +172,0 @@ implicitly determined to include all of the remaining contents of the |
@@ -188,7 +188,7 @@ .. currentmodule:: asdf.config | ||
| The default ASDF Standard version used for new files. This can be overridden | ||
| The default ASDF core schemas version used for new files. This can be overridden | ||
| on an individual file basis (using the version argument to `asdf.AsdfFile`) | ||
| or set here to change the default for all new files created in the current session. | ||
| Defaults to the latest stable ASDF Standard version. | ||
| Defaults to the latest stable ASDF core schemas version. | ||
@@ -208,9 +208,9 @@ io_block_size | ||
| Flag that controls filling default values from schemas for older versions of | ||
| the ASDF Standard. This library used to remove nodes from the tree whose | ||
| ASDF. This library used to remove nodes from the tree whose | ||
| values matched the default property in the schema. That behavior was changed | ||
| in `asdf` 2.8, but in order to read files produced by older versions of the library, | ||
| default values must still be filled from the schema for ASDF Standard <= 1.5.0. | ||
| default values must still be filled from the schema for ASDF core schemas <= 1.5.0. | ||
| Set to False to disable filling default values from the schema for these | ||
| older ASDF Standard versions. The flag has no effect for ASDF Standard >= 1.6.0. | ||
| older ASDF core schema versions. The flag has no effect for ASDF core schemas >= 1.6.0. | ||
@@ -217,0 +217,0 @@ Defaults to True. |
@@ -183,3 +183,3 @@ .. currentmodule:: asdf.extension | ||
| Some extensions may only work with specific version(s) of the ASDF | ||
| Standard -- for example, the schema associated with one of an extension's | ||
| core schemas -- for example, the schema associated with one of an extension's | ||
| tags may reference specific versions of ASDF core tags. This requirement | ||
@@ -198,3 +198,3 @@ can be expressed as a PEP 440 version specifier in an Extension's | ||
| Now the extension will only be used with ASDF Standard 1.3.0 and 1.4.0 files. | ||
| Now the extension will only be used with ASDF core schemas 1.3.0 and 1.4.0 files. | ||
@@ -201,0 +201,0 @@ Legacy class names |
@@ -70,4 +70,4 @@ .. _extending_manifests: | ||
| The optional ``asdf_standard_requirement`` property describes the | ||
| ASDF Standard versions that are compatible with this extension. The | ||
| ``gte`` and ``lt`` properties are used here to restrict ASDF Standard | ||
| ASDF core schema versions that are compatible with this extension. The | ||
| ``gte`` and ``lt`` properties are used here to restrict ASDF core schemas | ||
| versions to greater-than-or-equal 1.3.0 and less-than 1.5.0, respectively. | ||
@@ -74,0 +74,0 @@ ``gt`` and ``lte`` properties are also available. |
@@ -52,3 +52,3 @@ .. _extending_schemas: | ||
| This is similar to the quantity schema, found :ref:`here <asdf-standard:stsci.edu/asdf/unit/quantity-1.1.0>`, of the ASDF Standard, but | ||
| This is similar to the quantity schema, found :ref:`here <asdf-standard:stsci.edu/asdf/unit/quantity-1.1.0>`, but | ||
| has been updated to reflect current recommendations regarding schemas. | ||
@@ -74,3 +74,3 @@ Let's walk through this schema line by line. | ||
| this document. Since our document is itself a schema, the URI refers to | ||
| a *metaschema*. ASDF comes with three built-in metaschemas: | ||
| a *metaschema*. ASDF comes with two built-in metaschemas: | ||
@@ -84,5 +84,4 @@ - ``http://json-schema.org/draft-04/schema`` - The JSON Schema Draft 4 metaschema. | ||
| - ``http://stsci.edu/schemas/asdf/asdf-schema-1.0.0`` - The ASDF Schema metaschema. | ||
| Includes everything in YAML Schema, plus additional ASDF-specific validators | ||
| that check ndarray properties. | ||
| Using any other metaschema is not recommended as these are generally poorly | ||
| supported by jsonschema validators. | ||
@@ -89,0 +88,0 @@ Our schema makes use of the ``tag`` validator, so we're specifying the YAML Schema |
+10
-10
@@ -26,3 +26,3 @@ .. currentmodule:: asdf | ||
| The ASDF Standard imposes a maximum size of 64-bit signed integers literals in | ||
| The ASDF specification imposes a maximum size of 64-bit signed integers literals in | ||
| the tree (see :ref:`asdf-standard:literal_integers` for details and justification). | ||
@@ -39,3 +39,3 @@ Attempting to store a larger value as a YAML literal will result in a validation | ||
| The ASDF standard does not have an immutable sequence type that maps directly | ||
| The ASDF specification does not have an immutable sequence type that maps directly | ||
| to Python's :class:`tuple`. Following the behavior of | ||
@@ -106,3 +106,3 @@ pyyaml, asdf writes tuples as YAML sequences, which when loaded | ||
| Schema validation is used to determine whether an ASDF file is well formed. All | ||
| ASDF files must conform to the schemas defined by the :ref:`ASDF Standard | ||
| ASDF files must conform to the schemas defined by the :ref:`ASDF specification | ||
| <asdf-standard:asdf-standard>`. Schema validation can be run using `AsdfFile.validate` | ||
@@ -125,3 +125,3 @@ and occurs when reading ASDF files (using `asdf.open`) and writing them out | ||
| Every ASDF file is validated against the ASDF Standard, and also against any | ||
| Every ASDF file is validated against the ASDF core schemas, and also against any | ||
| schemas provided by custom extensions. However, it is sometimes useful for | ||
@@ -208,3 +208,3 @@ particular applications to impose additional restrictions when deciding whether | ||
| * The software package version | ||
| * The ASDF Standard version | ||
| * The ASDF core schemas version | ||
| * The ASDF file format version | ||
@@ -214,3 +214,3 @@ * Individual tag, schema, and extension versions | ||
| Each ASDF file contains information about the various versions that were used | ||
| to create the file. The most important of these are the ASDF Standard version | ||
| to create the file. The most important of these are the ASDF core schemas version | ||
| and the ASDF file format version. A particular version of the ASDF software | ||
@@ -225,3 +225,3 @@ package will explicitly provide support for specific combinations of these | ||
| Since ASDF is designed to serve as an archival format, this library is careful | ||
| to maintain backwards compatibility with older versions of the ASDF Standard, ASDF | ||
| to maintain backwards compatibility with older versions of the ASDF core schemas, ASDF | ||
| file format, and core tags. However, since deserializing custom tags | ||
@@ -231,10 +231,10 @@ requires other software packages, backwards compatibility is often | ||
| In general, forward compatibility with newer versions of the ASDF Standard and | ||
| In general, forward compatibility with newer versions of the ASDF core schemas and | ||
| ASDF file format is not supported by the software. | ||
| When creating new ASDF files, it is possible to control the version of the ASDF | ||
| standard that is used. This can be specified by passing the ``version`` argument to | ||
| core schemas that is used. This can be specified by passing the ``version`` argument to | ||
| either the `AsdfFile` constructor when the file object is created, or to the | ||
| `AsdfFile.write_to` method when it is written. By default, the latest stable | ||
| version of the ASDF standard will be used. | ||
| version of the ASDF core schemas will be used. | ||
@@ -241,0 +241,0 @@ .. warning:: |
+1
-1
@@ -84,3 +84,3 @@ .. _asdf: | ||
| - The :ref:`Advanced Scientific Data Format (ASDF) standard | ||
| - The :ref:`Advanced Scientific Data Format (ASDF) specification | ||
| <asdf-standard:asdf-standard>`. | ||
@@ -87,0 +87,0 @@ |
+4
-4
| Metadata-Version: 2.4 | ||
| Name: asdf | ||
| Version: 4.4.0 | ||
| Version: 4.5.0 | ||
| Summary: Python implementation of the ASDF Standard | ||
@@ -91,4 +91,4 @@ Author-email: The ASDF Developers <help@stsci.edu> | ||
| next-generation interchange format for scientific data. This package | ||
| contains the Python implementation of the ASDF Standard. More | ||
| information on the ASDF Standard itself can be found | ||
| contains the Python implementation of the ASDF specification. More | ||
| information on the ASDF file format including the specification can be found | ||
| `here <https://asdf-standard.readthedocs.io>`__. | ||
@@ -407,3 +407,3 @@ | ||
| More information on the ASDF Standard itself can be found | ||
| More information on the ASDF file format itself can be found | ||
| `here <https://asdf-standard.readthedocs.io>`__. | ||
@@ -410,0 +410,0 @@ |
| import importlib | ||
| import os | ||
| import pathlib | ||
| import warnings | ||
| from dataclasses import dataclass | ||
@@ -131,2 +132,5 @@ | ||
| # warn inside test, we don't do this yet to allow time for downstream packages to adopt pytest-asdf-plugin | ||
| warnings.warn("pytest_asdf is deprecated, install pytest_asdf_plugin instead", DeprecationWarning) | ||
| # Make sure that each schema itself is valid. | ||
@@ -209,3 +213,3 @@ schema_tree = schema.load_schema( | ||
| # warn inside test, we don't do this yet to allow time for downstream packages to adopt pytest-asdf-plugin | ||
| # warnings.warn("pytest_asdf is deprecated, install pytest_asdf_plugin instead", DeprecationWarning) | ||
| warnings.warn("pytest_asdf is deprecated, install pytest_asdf_plugin instead", DeprecationWarning) | ||
@@ -212,0 +216,0 @@ # check the example is valid |
+3
-3
@@ -43,4 +43,4 @@ ASDF - Advanced Scientific Data Format | ||
| next-generation interchange format for scientific data. This package | ||
| contains the Python implementation of the ASDF Standard. More | ||
| information on the ASDF Standard itself can be found | ||
| contains the Python implementation of the ASDF specification. More | ||
| information on the ASDF file format including the specification can be found | ||
| `here <https://asdf-standard.readthedocs.io>`__. | ||
@@ -359,3 +359,3 @@ | ||
| More information on the ASDF Standard itself can be found | ||
| More information on the ASDF file format itself can be found | ||
| `here <https://asdf-standard.readthedocs.io>`__. | ||
@@ -362,0 +362,0 @@ |
Alert delta unavailable
Currently unable to show alert delta for PyPI packages.
4684256
0.05%120480
0.03%