AddressWriter#

class lsst.pipe.base.quantum_graph.AddressWriter(addresses: list[dict[~uuid.UUID, ~lsst.pipe.base.quantum_graph._multiblock.Address]] = <factory>)#

Bases: object

A helper object for writing address files for multi-block files.

Attributes Summary

addresses

Addresses to store with each UUID.

Methods Summary

get_all_ids()

Return all IDs used by any address dictionary.

write(stream, int_size[, all_ids])

Write all addresses to a file-like object.

write_to_zip(zf, name, int_size)

Write all addresses to a file in a zip archive.

Attributes Documentation

addresses: list[dict[UUID, Address]] = <dataclasses._MISSING_TYPE object>#

Addresses to store with each UUID.

Every key in one of these dictionaries must have an entry in indices. The converse is not true.

Methods Documentation

get_all_ids() Set[UUID]#

Return all IDs used by any address dictionary.

Returns#

all_idsSet [uuid.UUID]

Set of all IDs.

write(stream: IO[bytes], int_size: int, all_ids: Set[UUID] | None = None) None#

Write all addresses to a file-like object.

Parameters#

streamtyping.IO [ bytes ]

Binary file-like object.

int_sizeint

Number of bytes to use for all integers.

all_idsSet [uuid.UUID], optional

Set of the union of all UUIDs in any dictionary from a call to get_all_ids.

write_to_zip(zf: ZipFile, name: str, int_size: int) None#

Write all addresses to a file in a zip archive.

Parameters#

zfzipfile.ZipFile

Zip archive to add the file to.

namestr

Base name for the address file; an extension will be added.

int_sizeint

Number of bytes to use for all integers.