AddressWriter#

class lsst.pipe.base.quantum_graph.AddressWriter(indices: dict[~uuid.UUID, int] = <factory>, 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.

indices

Mapping from UUID to internal integer ID.

Methods Summary

write(stream, int_size)

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.

indices: dict[UUID, int] = <dataclasses._MISSING_TYPE object>#

Mapping from UUID to internal integer ID.

The internal integer ID must always correspond to the index into the sorted list of all UUIDs, but this dict need not be sorted itself.

Methods Documentation

write(stream: IO[bytes], int_size: int) 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.

write_to_zip(zf: zipfile.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.