Skip to content

Asdf

check_file

check_file(file: AsdfFile, spec: Filetype) -> dict[str, list[str]]

Compare FILE to the expectations described by SPEC. Return a semi-structured description of the differences. An empty dict means no significant differences were found.

check_obj

check_obj(obj: Any, obj_spec: DataObject, options: FiletypeValidationOptions) -> dict[str, str]

Does obj match obj_spec (possibly skipping some checks as specified in options?

Returns:

  • dict[str, str]

    dict like {check_name: failures}. Empty if all checks passed.

check_obj_array_props

check_obj_array_props(obj: Any, spec: DataObject, valopts: FiletypeValidationOptions) -> list[str] | None

Does obj have the array properties specified in spec?

Returns:

  • list[str] | None

    None if match is ok, list of failures if not.

check_obj_schema

check_obj_schema(obj: Any, spec: DataObject, _valopts: FiletypeValidationOptions) -> dict[str, list[str]] | None

Does obj match the schema specified in spec?

Returns:

  • dict[str, list[str]] | None

    None if match is ok, dict of failures if not.

check_obj_type

check_obj_type(obj: Any, spec: DataObject, _valopts: FiletypeValidationOptions) -> list[str] | None

Does obj match the object type specified in spec?

Returns:

  • list[str] | None

    None if match is ok, list of failures if not.

check_obj_value

check_obj_value(obj: Any, spec: DataObject, _valopts: FiletypeValidationOptions) -> list[str] | None

Does obj match the value specified in spec?

Returns:

  • list[str] | None

    None if match is ok, list of failures if not.

comparable_to_yaml_literal

comparable_to_yaml_literal(obj: Any) -> bool

Is this object viable for strict equality comparison to YAML 'literal'?

find_objects

find_objects(file: AsdfFile, objspec: DataObject) -> list[tuple[str, Any]]

Find all objects in an ASDF file that appear to be described by objspec.

Returns:

  • list[tuple[str, Any]]

    list of tuples like [(path, node), ...] for all matching objects.