ArchiveTree#

pydantic model lsst.images.serialization.ArchiveTree#

An intermediate base class of pydantic.BaseModel that should be used for all objects that may be used as the top-level tree models written to archives.

See Schema versioning for how the SCHEMA_NAME / SCHEMA_VERSION / MIN_READ_VERSION constants and the schema_version / min_read_version / schema_url fields are used.

Parameters:

data (Any)

Fields:
Validators:
  • _check_and_normalize_schema_version » all fields

field butler_info: ButlerInfo | None = None#

Information about the butler dataset backed by this file.

Validated by:
  • _check_and_normalize_schema_version

field indirect: list[Any] [Optional]#

Serialized nested objects that may be saved or read more than once.

Validated by:
  • _check_and_normalize_schema_version

field metadata: dict[str, MetadataValue] [Optional]#

Additional unstructured metadata.

Validated by:
  • _check_and_normalize_schema_version

field min_read_version: int = 1#

Smallest reader major that can interpret this tree.

Validated by:
  • _check_and_normalize_schema_version

field schema_version: str = '1.0.0'#

Data-model schema version of this tree (major.minor.patch).

Validated by:
  • _check_and_normalize_schema_version

abstract deserialize(archive, **kwargs)#

Return the in-memory object that was serialized to this tree.

Parameters:
  • archive (InputArchive[Any]) – The input archive to read from.

  • **kwargs (Any) – Additional keyword arguments specific to this type.

Raises:

InvalidParameterError – Raised for unsupported **kwargs.

Return type:

Any

Notes

Subclass implementations may take additional keyword-only arguments. Callers that invoke this method without knowing what those might be should catch TypeError and re-raise as InvalidParameterError if they pass additional keyword arguments.

deserialize_component(component, archive, **kwargs)#

Return a component in-memory object that was serialized to this tree.

Parameters:
  • component (str) – Name of the component to read.

  • archive (InputArchive[Any]) – The input archive to read from.

  • **kwargs (Any) – Additional keyword arguments specific to this type.

Raises:
Return type:

Any

Notes

The default implementation for this method tries to get an attribute with the component’s name from self, and then:

If there is no such attribute, it raises InvalidComponentError.

**kwargs are forwarded to component deserialize methods, but are otherwise not checked. Subclasses are generally expected to implement this method to do that checking and handle any components for which the other will not work, and then delegate to super at the end.

MIN_READ_VERSION: ClassVar[int]#
PUBLIC_TYPE: ClassVar[type]#

In-memory Python type produced by this tree’s deserialize (e.g. dict for a mapping return). Declared explicitly by each concrete subclass and surfaced by public_type_for_schema.

SCHEMA_NAME: ClassVar[str]#
SCHEMA_URL_BASE: ClassVar[str] = 'https://images.lsst.io/schemas'#

Base for this schema’s URL, as {SCHEMA_URL_BASE}/{name}-{version}.

External packages providing their own schemas should override this (once, on a shared intermediate base class) so their schema URLs are minted under a documentation site they control rather than images.lsst.io.

SCHEMA_VERSION: ClassVar[str]#
property schema_url: str#

Return the schema URL of this tree’s class.

Computed from SCHEMA_NAME and SCHEMA_VERSION ClassVars.

This page was last modified on .