File tree 2 files changed +0
-164
lines changed
2 files changed +0
-164
lines changed Original file line number Diff line number Diff line change 1
- import textwrap
2
1
from typing import ClassVar
3
2
4
- import yaml
5
3
from pydantic import BaseModel
6
4
7
5
@@ -40,30 +38,3 @@ def asdf_yaml_tree(self) -> dict:
40
38
)
41
39
42
40
return d
43
-
44
- @classmethod
45
- def schema_asdf (
46
- cls , * , metaschema : str = "http://stsci.edu/schemas/asdf/asdf-schema-1.0.0"
47
- ) -> str :
48
- """Get the ASDF schema definition for this model.
49
-
50
- Parameters
51
- ----------
52
- metaschema, optional
53
- A metaschema URI, by default "http://stsci.edu/schemas/asdf/asdf-schema-1.0.0".
54
- See https://asdf.readthedocs.io/en/stable/asdf/extending/schemas.html#anatomy-of-a-schema
55
- for more options.
56
- """ # noqa: E501
57
- # TODO: Function signature should follow BaseModel.schema() or
58
- # BaseModel.schema_json()
59
- header = textwrap .dedent (
60
- f"""
61
- %YAML 1.1
62
- ---
63
- $schema: { metaschema }
64
- id: { cls ._tag }
65
-
66
- """
67
- )
68
- body = yaml .dump (cls .schema ())
69
- return header + body
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments