From fe90c13579e6644944ffb0f4915674f9291778ab Mon Sep 17 00:00:00 2001 From: Brett Date: Wed, 7 Feb 2024 16:54:16 -0500 Subject: [PATCH 1/8] switch default asdf-standard to 1.6.0 --- asdf/_tests/core/_converters/test_tree.py | 3 +- asdf/_tests/tags/core/tests/test_ndarray.py | 56 ++++++++++----------- asdf/_tests/test_history.py | 2 +- asdf/_tests/test_info.py | 9 +++- asdf/_tests/test_schema.py | 20 ++++---- asdf/_tests/test_types.py | 4 +- asdf/_tests/test_yaml.py | 2 +- asdf/versioning.py | 4 +- docs/asdf/config.rst | 6 +-- 9 files changed, 58 insertions(+), 48 deletions(-) diff --git a/asdf/_tests/core/_converters/test_tree.py b/asdf/_tests/core/_converters/test_tree.py index 4c40b36e5..ddad4aa4c 100644 --- a/asdf/_tests/core/_converters/test_tree.py +++ b/asdf/_tests/core/_converters/test_tree.py @@ -77,6 +77,7 @@ def test_history_entry(tmp_path): def test_subclass_metadata(): subclass_metadata = SubclassMetadata(name="SomeCoolSubclass") - result = helpers.roundtrip_object(subclass_metadata) + # support for this was dropped in 1.6.0 + result = helpers.roundtrip_object(subclass_metadata, version="1.5.0") assert result == subclass_metadata diff --git a/asdf/_tests/tags/core/tests/test_ndarray.py b/asdf/_tests/tags/core/tests/test_ndarray.py index 08a2202fe..bfc5b48b1 100644 --- a/asdf/_tests/tags/core/tests/test_ndarray.py +++ b/asdf/_tests/tags/core/tests/test_ndarray.py @@ -282,7 +282,7 @@ class NDArrayContainerExtension: def test_copy_inline(): yaml = """ -x0: !core/ndarray-1.0.0 +x0: !core/ndarray-1.1.0 data: [-1.0, 1.0] """ @@ -371,7 +371,7 @@ def test_inline(): def test_inline_bare(): - content = "arr: !core/ndarray-1.0.0 [[1, 2, 3, 4], [5, 6, 7, 8]]" + content = "arr: !core/ndarray-1.1.0 [[1, 2, 3, 4], [5, 6, 7, 8]]" buff = helpers.yaml_to_asdf(content) with asdf.open(buff) as ff: @@ -413,7 +413,7 @@ def test_len_roundtrip(tmp_path): def test_mask_arbitrary(): content = """ -arr: !core/ndarray-1.0.0 +arr: !core/ndarray-1.1.0 data: [[1, 2, 3, 1234], [5, 6, 7, 8]] mask: 1234 """ @@ -425,7 +425,7 @@ def test_mask_arbitrary(): def test_mask_nan(): content = """ -arr: !core/ndarray-1.0.0 +arr: !core/ndarray-1.1.0 data: [[1, 2, 3, .NaN], [5, 6, 7, 8]] mask: .NaN """ @@ -455,7 +455,7 @@ def test_string_table(tmp_path): def test_inline_string(): - content = "arr: !core/ndarray-1.0.0 ['a', 'b', 'c']" + content = "arr: !core/ndarray-1.1.0 ['a', 'b', 'c']" buff = helpers.yaml_to_asdf(content) with asdf.open(buff) as ff: @@ -464,7 +464,7 @@ def test_inline_string(): def test_inline_structured(): content = """ -arr: !core/ndarray-1.0.0 +arr: !core/ndarray-1.1.0 datatype: [['ascii', 4], uint16, uint16, ['ascii', 4]] data: [[M110, 110, 205, And], [ M31, 31, 224, And], @@ -622,10 +622,10 @@ def test_operations_on_ndarray_proxies(tmp_path): def test_mask_datatype(tmp_path): content = """ -arr: !core/ndarray-1.0.0 +arr: !core/ndarray-1.1.0 data: [1, 2, 3] dtype: int32 - mask: !core/ndarray-1.0.0 + mask: !core/ndarray-1.1.0 data: [true, true, false] """ buff = helpers.yaml_to_asdf(content) @@ -636,10 +636,10 @@ def test_mask_datatype(tmp_path): def test_invalid_mask_datatype(tmp_path): content = """ -arr: !core/ndarray-1.0.0 +arr: !core/ndarray-1.1.0 data: [1, 2, 3] dtype: int32 - mask: !core/ndarray-1.0.0 + mask: !core/ndarray-1.1.0 data: ['a', 'b', 'c'] """ buff = helpers.yaml_to_asdf(content) @@ -657,7 +657,7 @@ def test_invalid_mask_datatype(tmp_path): def test_ndim_validation(tmp_path): content = """ obj: ! - a: !core/ndarray-1.0.0 + a: !core/ndarray-1.1.0 data: [1, 2, 3] """ buff = helpers.yaml_to_asdf(content) @@ -672,7 +672,7 @@ def test_ndim_validation(tmp_path): content = """ obj: ! - a: !core/ndarray-1.0.0 + a: !core/ndarray-1.1.0 data: [[1, 2, 3]] """ buff = helpers.yaml_to_asdf(content) @@ -682,7 +682,7 @@ def test_ndim_validation(tmp_path): content = """ obj: ! - a: !core/ndarray-1.0.0 + a: !core/ndarray-1.1.0 shape: [1, 3] data: [[1, 2, 3]] """ @@ -693,7 +693,7 @@ def test_ndim_validation(tmp_path): content = """ obj: ! - b: !core/ndarray-1.0.0 + b: !core/ndarray-1.1.0 data: [1, 2, 3] """ buff = helpers.yaml_to_asdf(content) @@ -703,7 +703,7 @@ def test_ndim_validation(tmp_path): content = """ obj: ! - b: !core/ndarray-1.0.0 + b: !core/ndarray-1.1.0 data: [[1, 2, 3]] """ buff = helpers.yaml_to_asdf(content) @@ -713,7 +713,7 @@ def test_ndim_validation(tmp_path): content = """ obj: ! - b: !core/ndarray-1.0.0 + b: !core/ndarray-1.1.0 data: [[[1, 2, 3]]] """ buff = helpers.yaml_to_asdf(content) @@ -731,7 +731,7 @@ def test_ndim_validation(tmp_path): def test_datatype_validation(tmp_path): content = """ obj: ! - a: !core/ndarray-1.0.0 + a: !core/ndarray-1.1.0 data: [1, 2, 3] datatype: float32 """ @@ -742,7 +742,7 @@ def test_datatype_validation(tmp_path): content = """ obj: ! - a: !core/ndarray-1.0.0 + a: !core/ndarray-1.1.0 data: [1, 2, 3] datatype: float64 """ @@ -758,7 +758,7 @@ def test_datatype_validation(tmp_path): content = """ obj: ! - a: !core/ndarray-1.0.0 + a: !core/ndarray-1.1.0 data: [1, 2, 3] datatype: int16 """ @@ -769,7 +769,7 @@ def test_datatype_validation(tmp_path): content = """ obj: ! - b: !core/ndarray-1.0.0 + b: !core/ndarray-1.1.0 data: [1, 2, 3] datatype: int16 """ @@ -785,7 +785,7 @@ def test_datatype_validation(tmp_path): content = """ obj: ! - a: !core/ndarray-1.0.0 + a: !core/ndarray-1.1.0 data: [[1, 'a'], [2, 'b'], [3, 'c']] datatype: - name: a @@ -808,7 +808,7 @@ def test_datatype_validation(tmp_path): def test_structured_datatype_validation(tmp_path): content = """ obj: ! - c: !core/ndarray-1.0.0 + c: !core/ndarray-1.1.0 data: [[1, 'a'], [2, 'b'], [3, 'c']] datatype: - name: a @@ -823,7 +823,7 @@ def test_structured_datatype_validation(tmp_path): content = """ obj: ! - c: !core/ndarray-1.0.0 + c: !core/ndarray-1.1.0 data: [[1, 'a'], [2, 'b'], [3, 'c']] datatype: - name: a @@ -843,7 +843,7 @@ def test_structured_datatype_validation(tmp_path): content = """ obj: ! - c: !core/ndarray-1.0.0 + c: !core/ndarray-1.1.0 data: [[1, 'a', 0], [2, 'b', 1], [3, 'c', 2]] datatype: - name: a @@ -865,7 +865,7 @@ def test_structured_datatype_validation(tmp_path): content = """ obj: ! - c: !core/ndarray-1.0.0 + c: !core/ndarray-1.1.0 data: [1, 2, 3] """ buff = helpers.yaml_to_asdf(content) @@ -880,7 +880,7 @@ def test_structured_datatype_validation(tmp_path): content = """ obj: ! - d: !core/ndarray-1.0.0 + d: !core/ndarray-1.1.0 data: [[1, 'a'], [2, 'b'], [3, 'c']] datatype: - name: a @@ -900,7 +900,7 @@ def test_structured_datatype_validation(tmp_path): content = """ obj: ! - d: !core/ndarray-1.0.0 + d: !core/ndarray-1.1.0 data: [[1, 'a'], [2, 'b'], [3, 'c']] datatype: - name: a @@ -924,7 +924,7 @@ def test_string_inline(): def test_inline_shape_mismatch(): content = """ -arr: !core/ndarray-1.0.0 +arr: !core/ndarray-1.1.0 data: [1, 2, 3] shape: [2] """ diff --git a/asdf/_tests/test_history.py b/asdf/_tests/test_history.py index 8da69a354..4c36756a9 100644 --- a/asdf/_tests/test_history.py +++ b/asdf/_tests/test_history.py @@ -108,7 +108,7 @@ def test_extension_metadata(tmp_path): with asdf.open(file_path) as af: assert len(af.tree["history"]["extensions"]) == 1 metadata = af.tree["history"]["extensions"][0] - assert metadata.extension_uri == "asdf://asdf-format.org/core/extensions/core-1.5.0" + assert metadata.extension_uri == "asdf://asdf-format.org/core/extensions/core-1.6.0" assert metadata.extension_class == "asdf.extension._manifest.ManifestExtension" assert metadata.software["name"] == "asdf" assert metadata.software["version"] == asdf.__version__ diff --git a/asdf/_tests/test_info.py b/asdf/_tests/test_info.py index fe4e114f4..210786af6 100644 --- a/asdf/_tests/test_info.py +++ b/asdf/_tests/test_info.py @@ -647,7 +647,14 @@ def test_recursive_info_object_support(capsys, tmp_path): recursive_obj = RecursiveObjectWithInfoSupport() recursive_obj.recursive = recursive_obj tree = {"random": 3.14159, "rtest": recursive_obj} - af = asdf.AsdfFile(tree) + af = asdf.AsdfFile() + # we need to do this to avoid validation against the + # manifest (generated in manifest_extension) which is + # now supported with the default asdf standard 1.6.0 + # I'm not sure why the manifest has this restriction + # and prior to switching to the default 1.6.0 was ignored + # which allowed this test to pass. + af._tree = tree af.info(refresh_extension_manager=True) captured = capsys.readouterr() assert "recursive reference" in captured.out diff --git a/asdf/_tests/test_schema.py b/asdf/_tests/test_schema.py index b8b8bef61..f6094263d 100644 --- a/asdf/_tests/test_schema.py +++ b/asdf/_tests/test_schema.py @@ -51,7 +51,7 @@ class TagReferenceExtension: name: type: string things: - $ref: "http://stsci.edu/schemas/asdf/core/ndarray-1.0.0" + $ref: "http://stsci.edu/schemas/asdf/core/ndarray-1.1.0" required: [name, things] ... """ @@ -124,7 +124,7 @@ def test_load_schema(tmp_path): type: object properties: foobar: - $ref: "../core/ndarray-1.0.0" + $ref: "../core/ndarray-1.1.0" required: [foobar] ... @@ -148,7 +148,7 @@ def test_load_schema_with_file_url(tmp_path): type: object properties: foobar: - $ref: "http://stsci.edu/schemas/asdf/core/ndarray-1.0.0" + $ref: "http://stsci.edu/schemas/asdf/core/ndarray-1.1.0" required: [foobar] ... @@ -377,7 +377,7 @@ def test_property_order(): ff = asdf.AsdfFile(tree) ff.write_to(buff) - ndarray_schema = schema.load_schema("http://stsci.edu/schemas/asdf/core/ndarray-1.0.0") + ndarray_schema = schema.load_schema("http://stsci.edu/schemas/asdf/core/ndarray-1.1.0") property_order = ndarray_schema["anyOf"][1]["propertyOrder"] last_index = 0 @@ -448,7 +448,7 @@ class CustomExtension: # Make sure tags get validated inside of other tags that know # nothing about them. yaml = f""" -array: !core/ndarray-1.0.0 +array: !core/ndarray-1.1.0 data: [0, 1, 2] custom: !<{tag_uri}> foo @@ -511,7 +511,7 @@ def test_check_complex_default(): schema.check_schema(s) - s["properties"]["a"]["tag"] = "tag:stsci.edu/asdf/core/ndarray-1.0.0" + s["properties"]["a"]["tag"] = "tag:stsci.edu/asdf/core/ndarray-1.1.0" with pytest.raises(ValidationError, match=r"mismatched tags, wanted .*, got .*"): schema.check_schema(s) @@ -598,6 +598,8 @@ class DefaultExtension: extension_uri = "http://nowhere.org/extensions/custom/default-1.0.0" with config_context() as cfg: + # later versions do not fill defaults + cfg.default_version = "1.5.0" cfg.add_extension(DefaultExtension()) cfg.add_resource_mapping({schema_uri: tag_schema}) yaml = """ @@ -608,7 +610,7 @@ class DefaultExtension: j: l: 362 """ - buff = yaml_to_asdf(yaml) + buff = yaml_to_asdf(yaml, standard_version="1.5.0") with asdf.open(buff) as ff: assert "a" in ff.tree["custom"] assert ff.tree["custom"]["a"] == 42 @@ -730,7 +732,7 @@ def test_tag_reference_validation(): custom: ! name: "Something" - things: !core/ndarray-1.0.0 + things: !core/ndarray-1.1.0 data: [1, 2, 3] """ @@ -787,7 +789,7 @@ class ForeignTagReferenceExtension: a: ! name: "Something" - things: !core/ndarray-1.0.0 + things: !core/ndarray-1.1.0 data: [1, 2, 3] """ diff --git a/asdf/_tests/test_types.py b/asdf/_tests/test_types.py index 825c5d718..213b710c1 100644 --- a/asdf/_tests/test_types.py +++ b/asdf/_tests/test_types.py @@ -16,10 +16,10 @@ def test_undefined_tag(with_lazy_tree): ! - 5 - {'message': 'there is no tag'} - - !core/ndarray-1.0.0 + - !core/ndarray-1.1.0 [[1, 2, 3], [4, 5, 6]] - ! - - !core/ndarray-1.0.0 [[7],[8],[9],[10]] + - !core/ndarray-1.1.0 [[7],[8],[9],[10]] - !core/complex-1.0.0 3.14j """ buff = yaml_to_asdf(yaml) diff --git a/asdf/_tests/test_yaml.py b/asdf/_tests/test_yaml.py index 0e6eae02d..96dd84908 100644 --- a/asdf/_tests/test_yaml.py +++ b/asdf/_tests/test_yaml.py @@ -167,7 +167,7 @@ def test_explicit_tags(): #ASDF_STANDARD 1.5.0 %YAML 1.1 --- ! -foo: ! [1, 2, 3] +foo: ! [1, 2, 3] ...""" # Check that fully qualified explicit tags work diff --git a/asdf/versioning.py b/asdf/versioning.py index 160c0f62d..bfbce131e 100644 --- a/asdf/versioning.py +++ b/asdf/versioning.py @@ -94,11 +94,11 @@ def __init__(self, version): ] -default_version = AsdfVersion("1.5.0") +default_version = AsdfVersion("1.6.0") # This is the ASDF Standard version that is currently in development # it is possible that breaking changes will be made to this version. -asdf_standard_development_version = AsdfVersion("1.6.0") +asdf_standard_development_version = AsdfVersion("1.7.0") # This is the ASDF Standard version at which the format of the history diff --git a/docs/asdf/config.rst b/docs/asdf/config.rst index 38e62e128..13327c01b 100644 --- a/docs/asdf/config.rst +++ b/docs/asdf/config.rst @@ -41,7 +41,7 @@ the currently active config: all_array_compression_kwargs: None default_array_save_base: True convert_unknown_ndarray_subclasses: False - default_version: 1.5.0 + default_version: 1.6.0 io_block_size: -1 legacy_fill_schema_defaults: True validate_on_read: True @@ -67,7 +67,7 @@ This allows for short-lived configuration changes that do not impact other code: all_array_compression_kwargs: None default_array_save_base: True convert_unknown_ndarray_subclasses: False - default_version: 1.5.0 + default_version: 1.6.0 io_block_size: -1 legacy_fill_schema_defaults: True validate_on_read: False @@ -81,7 +81,7 @@ This allows for short-lived configuration changes that do not impact other code: all_array_compression_kwargs: None default_array_save_base: True convert_unknown_ndarray_subclasses: False - default_version: 1.5.0 + default_version: 1.6.0 io_block_size: -1 legacy_fill_schema_defaults: True validate_on_read: True From eb3b9c39c47108afe148e658b51971a812f9dcc8 Mon Sep 17 00:00:00 2001 From: Brett Date: Thu, 8 Feb 2024 09:16:41 -0500 Subject: [PATCH 2/8] update metaschema version in tests --- asdf/_tests/tags/core/tests/test_ndarray.py | 4 ++-- asdf/_tests/test_info.py | 6 +++--- asdf/_tests/test_schema.py | 16 ++++++++-------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/asdf/_tests/tags/core/tests/test_ndarray.py b/asdf/_tests/tags/core/tests/test_ndarray.py index bfc5b48b1..d12020d63 100644 --- a/asdf/_tests/tags/core/tests/test_ndarray.py +++ b/asdf/_tests/tags/core/tests/test_ndarray.py @@ -75,7 +75,7 @@ def with_custom_extension(): { "http://nowhere.org/schemas/custom/datatype-1.0.0": """%YAML 1.1 --- -$schema: "http://stsci.edu/schemas/asdf/asdf-schema-1.0.0" +$schema: "http://stsci.edu/schemas/asdf/asdf-schema-1.1.0" id: "http://nowhere.org/schemas/custom/datatype-1.0.0" type: object properties: @@ -102,7 +102,7 @@ def with_custom_extension(): exact_datatype: true""", "http://nowhere.org/schemas/custom/ndim-1.0.0": """%YAML 1.1 --- -$schema: "http://stsci.edu/schemas/asdf/asdf-schema-1.0.0" +$schema: "http://stsci.edu/schemas/asdf/asdf-schema-1.1.0" id: "http://nowhere.org/schemas/custom/ndim-1.0.0" type: object properties: diff --git a/asdf/_tests/test_info.py b/asdf/_tests/test_info.py index 210786af6..94353051b 100644 --- a/asdf/_tests/test_info.py +++ b/asdf/_tests/test_info.py @@ -156,7 +156,7 @@ def manifest_extension(tmp_path): foo_schema = """ %YAML 1.1 --- -$schema: "asdf://stsci.edu/schemas/asdf/asdf-schema-1.0.0" +$schema: "asdf://stsci.edu/schemas/asdf/asdf-schema-1.1.0" id: "asdf://somewhere.org/asdf/schemas/foo-1.0.0" type: object @@ -221,7 +221,7 @@ def manifest_extension(tmp_path): bar_schema = """ %YAML 1.1 --- -$schema: "asdf://stsci.edu/schemas/asdf/asdf-schema-1.0.0" +$schema: "asdf://stsci.edu/schemas/asdf/asdf-schema-1.1.0" id: "asdf://somewhere.org/asdf/schemas/bar-1.0.0" type: object @@ -245,7 +245,7 @@ def manifest_extension(tmp_path): drink_schema = """ %YAML 1.1 --- -$schema: "asdf://stsci.edu/schemas/asdf/asdf-schema-1.0.0" +$schema: "asdf://stsci.edu/schemas/asdf/asdf-schema-1.1.0" id: "asdf://somewhere.org/asdf/schemas/drink-1.0.0" type: object diff --git a/asdf/_tests/test_schema.py b/asdf/_tests/test_schema.py index f6094263d..99fe2da53 100644 --- a/asdf/_tests/test_schema.py +++ b/asdf/_tests/test_schema.py @@ -117,7 +117,7 @@ def test_load_schema(tmp_path): schema_def = """ %YAML 1.1 --- -$schema: "http://stsci.edu/schemas/asdf/asdf-schema-1.0.0" +$schema: "http://stsci.edu/schemas/asdf/asdf-schema-1.1.0" id: "http://stsci.edu/schemas/asdf/nugatory/nugatory-1.0.0" tag: "tag:stsci.edu:asdf/nugatory/nugatory-1.0.0" @@ -141,7 +141,7 @@ def test_load_schema_with_file_url(tmp_path): %YAML 1.1 %TAG !asdf! tag:stsci.edu:asdf/ --- -$schema: "http://stsci.edu/schemas/asdf/asdf-schema-1.0.0" +$schema: "http://stsci.edu/schemas/asdf/asdf-schema-1.1.0" id: "http://stsci.edu/schemas/asdf/nugatory/nugatory-1.0.0" tag: "tag:stsci.edu:asdf/nugatory/nugatory-1.0.0" @@ -163,7 +163,7 @@ def test_load_schema_with_file_url(tmp_path): def test_load_schema_with_asdf_uri_scheme(): subschema_content = """%YAML 1.1 --- -$schema: http://stsci.edu/schemas/asdf/asdf-schema-1.0.0 +$schema: http://stsci.edu/schemas/asdf/asdf-schema-1.1.0 id: asdf://somewhere.org/schemas/bar bar: @@ -172,7 +172,7 @@ def test_load_schema_with_asdf_uri_scheme(): """ content = """%YAML 1.1 --- -$schema: http://stsci.edu/schemas/asdf/asdf-schema-1.0.0 +$schema: http://stsci.edu/schemas/asdf/asdf-schema-1.1.0 id: asdf://somewhere.org/schemas/foo definitions: @@ -210,7 +210,7 @@ def test_load_schema_with_stsci_id(): """ subschema_content = """%YAML 1.1 --- -$schema: http://stsci.edu/schemas/asdf/asdf-schema-1.0.0 +$schema: http://stsci.edu/schemas/asdf/asdf-schema-1.1.0 id: http://stsci.edu/schemas/bar bar: @@ -219,7 +219,7 @@ def test_load_schema_with_stsci_id(): """ content = """%YAML 1.1 --- -$schema: http://stsci.edu/schemas/asdf/asdf-schema-1.0.0 +$schema: http://stsci.edu/schemas/asdf/asdf-schema-1.1.0 id: http://stsci.edu/schemas/foo definitions: @@ -1218,7 +1218,7 @@ def _test_validator(validator, value, instance, schema): def test_tag_validator(): content = """%YAML 1.1 --- -$schema: http://stsci.edu/schemas/asdf/asdf-schema-1.0.0 +$schema: http://stsci.edu/schemas/asdf/asdf-schema-1.1.0 id: asdf://somewhere.org/schemas/foo tag: asdf://somewhere.org/tags/foo ... @@ -1234,7 +1234,7 @@ def test_tag_validator(): content = """%YAML 1.1 --- -$schema: http://stsci.edu/schemas/asdf/asdf-schema-1.0.0 +$schema: http://stsci.edu/schemas/asdf/asdf-schema-1.1.0 id: asdf://somewhere.org/schemas/bar tag: asdf://somewhere.org/tags/bar-* ... From c27ab5d0f69a569b6cf937224b7ab90ca199e87b Mon Sep 17 00:00:00 2001 From: Brett Date: Wed, 27 Mar 2024 12:24:26 -0400 Subject: [PATCH 3/8] TMP: dev downstream --- tox.ini | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index 9161ab209..c2bce8e7e 100644 --- a/tox.ini +++ b/tox.ini @@ -284,7 +284,7 @@ allowlist_externals = extras = commands_pre = bash -c "pip freeze -q | grep 'asdf @' > {env_tmp_dir}/requirements.txt" - git clone https://github.com/BAMWelDX/weldx.git + git clone https://github.com/braingram/weldx.git -b schema_cleanup pip install -e weldx[test,media] pip install -r {env_tmp_dir}/requirements.txt pip freeze @@ -314,7 +314,9 @@ allowlist_externals = extras = commands_pre = bash -c "pip freeze -q | grep 'asdf @' > {env_tmp_dir}/requirements.txt" - git clone https://github.com/DKISTDC/dkist.git + git clone https://github.com/braingram/dkist.git -b schema_cleanup + git clone https://github.com/sunpy/sunpy.git + pip install -e sunpy[tests,all] pip install -e dkist[tests] pip install -r {env_tmp_dir}/requirements.txt pip freeze From d47936b5d36849e3e9eeb6c4bc181ad94a0d745c Mon Sep 17 00:00:00 2001 From: Brett Date: Wed, 27 Mar 2024 13:28:22 -0400 Subject: [PATCH 4/8] fix call to yaml_to_asdf after rebase --- asdf/_tests/test_schema.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/asdf/_tests/test_schema.py b/asdf/_tests/test_schema.py index 99fe2da53..544b42d60 100644 --- a/asdf/_tests/test_schema.py +++ b/asdf/_tests/test_schema.py @@ -610,7 +610,7 @@ class DefaultExtension: j: l: 362 """ - buff = yaml_to_asdf(yaml, standard_version="1.5.0") + buff = yaml_to_asdf(yaml, version="1.5.0") with asdf.open(buff) as ff: assert "a" in ff.tree["custom"] assert ff.tree["custom"]["a"] == 42 From 6530e28fe44c90e232b5680acd7684c56a327d78 Mon Sep 17 00:00:00 2001 From: Brett Date: Wed, 27 Mar 2024 13:38:05 -0400 Subject: [PATCH 5/8] fix test after rebase --- asdf/_tests/test_yaml.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/asdf/_tests/test_yaml.py b/asdf/_tests/test_yaml.py index 96dd84908..0e6eae02d 100644 --- a/asdf/_tests/test_yaml.py +++ b/asdf/_tests/test_yaml.py @@ -167,7 +167,7 @@ def test_explicit_tags(): #ASDF_STANDARD 1.5.0 %YAML 1.1 --- ! -foo: ! [1, 2, 3] +foo: ! [1, 2, 3] ...""" # Check that fully qualified explicit tags work From 8f6ae899ea47f4a548b618c08ccc8bd352dc4630 Mon Sep 17 00:00:00 2001 From: Brett Date: Fri, 2 Aug 2024 16:45:51 -0400 Subject: [PATCH 6/8] undo tox changes --- tox.ini | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tox.ini b/tox.ini index c2bce8e7e..9161ab209 100644 --- a/tox.ini +++ b/tox.ini @@ -284,7 +284,7 @@ allowlist_externals = extras = commands_pre = bash -c "pip freeze -q | grep 'asdf @' > {env_tmp_dir}/requirements.txt" - git clone https://github.com/braingram/weldx.git -b schema_cleanup + git clone https://github.com/BAMWelDX/weldx.git pip install -e weldx[test,media] pip install -r {env_tmp_dir}/requirements.txt pip freeze @@ -314,9 +314,7 @@ allowlist_externals = extras = commands_pre = bash -c "pip freeze -q | grep 'asdf @' > {env_tmp_dir}/requirements.txt" - git clone https://github.com/braingram/dkist.git -b schema_cleanup - git clone https://github.com/sunpy/sunpy.git - pip install -e sunpy[tests,all] + git clone https://github.com/DKISTDC/dkist.git pip install -e dkist[tests] pip install -r {env_tmp_dir}/requirements.txt pip freeze From e7258424aa5b34dcf02c8b0ba2df9304df96f1cf Mon Sep 17 00:00:00 2001 From: Brett Date: Mon, 28 Oct 2024 11:18:59 -0400 Subject: [PATCH 7/8] add changelog fragment --- changes/1744.feature.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 changes/1744.feature.rst diff --git a/changes/1744.feature.rst b/changes/1744.feature.rst new file mode 100644 index 000000000..abaa28618 --- /dev/null +++ b/changes/1744.feature.rst @@ -0,0 +1 @@ +Switch default ASDF standard to 1.6.0. From 1e4317d34128b8a005a8c51081e4f8035a3233a2 Mon Sep 17 00:00:00 2001 From: Brett Date: Fri, 8 Nov 2024 09:53:48 -0500 Subject: [PATCH 8/8] add standard change to what's new --- docs/asdf/whats_new.rst | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/docs/asdf/whats_new.rst b/docs/asdf/whats_new.rst index 8f9328cbf..5c8dd6884 100644 --- a/docs/asdf/whats_new.rst +++ b/docs/asdf/whats_new.rst @@ -46,6 +46,25 @@ Removed API New Defaults ------------ + +.. _whats_new_4.0.0_standard: + +ASDF standard version +^^^^^^^^^^^^^^^^^^^^^ + +By default asdf 4.0.0 will write files that use the 1.6.0 version of the +ASDF standard. This change should be transparent and all files +that use the older standards are readable. If you wish to write files +using the 1.5.0 (or older) ASDF standard you can provide a version +to `AsdfFile.write_to` or change `asdf.config.AsdfConfig.default_version`. + +In addition to new schemas and tags ASDF standard 1.6.0 comes with +a few other changes (scheduled for this version). + +- Opening files will no longer trigger `AsdfFile.fill_defaults`. +- Mapping keys are restricted to str, int, bool + See :external+asdf-standard:ref:`yaml_subset` + .. _whats_new_4.0.0_validation: Validation