spine.io.parse.hdf5.object

Lightweight parsers for cached HDF5 object products.

Classes

HDF5ObjectListParser(dtype, **kwargs)

Wrap one cached HDF5 object list into a ParserObjectList.

HDF5ObjectParser(dtype, **kwargs)

Return one cached HDF5 object as-is.

class spine.io.parse.hdf5.object.HDF5ObjectParser(dtype: str, **kwargs: Any)[source]

Return one cached HDF5 object as-is.

The HDF5 reader already rebuilds stored SPINE classes when build_classes=True. This parser simply forwards the reconstructed object into the dataset schema layer.

Attributes:
overlay

Methods

__call__(trees)

Parse one cached object entry.

get_input_data(trees)

Build the parser-call input dictionary from loaded tree products.

process(object_event)

Return one reconstructed cached object.

name: ClassVar[str | None] = 'object'
returns: ClassVar[str | None] = 'object'
process(object_event: Any) Any[source]

Return one reconstructed cached object.

Parameters:

object_event (object) – Reconstructed object loaded by HDF5Reader.

Returns:

Input object unchanged.

Return type:

object

class spine.io.parse.hdf5.object.HDF5ObjectListParser(dtype: str, **kwargs: Any)[source]

Wrap one cached HDF5 object list into a ParserObjectList.

This parser expects the HDF5 reader to have already reconstructed each element of the list as a local SPINE data object. It preserves an incoming ObjectList default when available and otherwise infers the default from the first element of the list.

Attributes:
overlay

Methods

__call__(trees)

Parse one cached object-list entry.

get_input_data(trees)

Build the parser-call input dictionary from loaded tree products.

process(object_list_event)

Normalize one reconstructed cached object list.

name: ClassVar[str | None] = 'object_list'
returns: ClassVar[str | None] = 'object_list'
process(object_list_event: ObjectList | list[Any]) ParserObjectList[source]

Normalize one reconstructed cached object list.

Parameters:

object_list_event (ObjectList or list[object]) – Reconstructed cached objects for one entry.

Returns:

Parsed object list.

Return type:

ParserObjectList

Raises:

ValueError – If the cached list is empty and does not carry a default object to preserve its intended type.