lsst.pipe.base  21.0.0-6-gd3283ba+1119941cbc
Public Member Functions | Public Attributes | List of all members
lsst.pipe.base.graph._loadHelpers.DefaultLoadHelper Class Reference
Inheritance diagram for lsst.pipe.base.graph._loadHelpers.DefaultLoadHelper:
lsst.pipe.base.graph._loadHelpers.FileLoadHelper lsst.pipe.base.graph._loadHelpers.OpenFileHandleHelper lsst.pipe.base.graph._loadHelpers.S3LoadHelper

Public Member Functions

def __init__ (self, Union[ButlerURI, io.IO[bytes]] uriObject)
 
QuantumGraph load (self, Optional[Iterable[int]] nodes=None, Optional[str] graphID=None)
 
def close (self)
 

Public Attributes

 uriObject
 
 headerSize
 
 save_version
 
 taskDefMap
 
 map
 
 buffer
 

Detailed Description

Default load helper for `QuantumGraph` save files

This class, and its subclasses, are used to unpack a quantum graph save
file. This file is a binary representation of the graph in a format that
allows individual nodes to be loaded without needing to load the entire
file.

This default implementation has the interface to load select nodes
from disk, but actually always loads the entire save file and simply
returns what nodes (or all) are requested. This is intended to serve for
all cases where there is a read method on the input parameter, but it is
unknown how to read select bytes of the stream. It is the responsibility of
sub classes to implement the method responsible for loading individual
bytes from the stream.

Parameters
----------
uriObject : `~lsst.daf.butler.ButlerURI` or `io.IO` of bytes
    This is the object that will be used to retrieve the raw bytes of the
    save.

Raises
------
ValueError
    Raised if the specified file contains the wrong file signature and is
    not a `QuantumGraph` save

Definition at line 79 of file _loadHelpers.py.

Constructor & Destructor Documentation

◆ __init__()

def lsst.pipe.base.graph._loadHelpers.DefaultLoadHelper.__init__ (   self,
Union[ButlerURI, io.IO[bytes]]  uriObject 
)

Definition at line 107 of file _loadHelpers.py.

Member Function Documentation

◆ close()

def lsst.pipe.base.graph._loadHelpers.DefaultLoadHelper.close (   self)
Cleans up an instance if needed. Base class does nothing

Reimplemented in lsst.pipe.base.graph._loadHelpers.FileLoadHelper.

Definition at line 272 of file _loadHelpers.py.

◆ load()

QuantumGraph lsst.pipe.base.graph._loadHelpers.DefaultLoadHelper.load (   self,
Optional[Iterable[int]]   nodes = None,
Optional[str]   graphID = None 
)
Loads in the specified nodes from the graph

Load in the `QuantumGraph` containing only the nodes specified in the
``nodes`` parameter from the graph specified at object creation. If
``nodes`` is None (the default) the whole graph is loaded.

Parameters
----------
nodes : `Iterable` of `int` or `None`
    The nodes to load from the graph, loads all if value is None
    (the default)
graphID : `str` or `None`
    If specified this ID is verified against the loaded graph prior to
    loading any Nodes. This defaults to None in which case no
    validation is done.

Returns
-------
graph : `QuantumGraph`
    The loaded `QuantumGraph` object

Raises
------
ValueError
    Raised if one or more of the nodes requested is not in the
    `QuantumGraph` or if graphID parameter does not match the graph
    being loaded.

Definition at line 163 of file _loadHelpers.py.

Member Data Documentation

◆ buffer

lsst.pipe.base.graph._loadHelpers.DefaultLoadHelper.buffer

Definition at line 269 of file _loadHelpers.py.

◆ headerSize

lsst.pipe.base.graph._loadHelpers.DefaultLoadHelper.headerSize

Definition at line 113 of file _loadHelpers.py.

◆ map

lsst.pipe.base.graph._loadHelpers.DefaultLoadHelper.map

Definition at line 161 of file _loadHelpers.py.

◆ save_version

lsst.pipe.base.graph._loadHelpers.DefaultLoadHelper.save_version

Definition at line 142 of file _loadHelpers.py.

◆ taskDefMap

lsst.pipe.base.graph._loadHelpers.DefaultLoadHelper.taskDefMap

Definition at line 154 of file _loadHelpers.py.

◆ uriObject

lsst.pipe.base.graph._loadHelpers.DefaultLoadHelper.uriObject

Definition at line 108 of file _loadHelpers.py.


The documentation for this class was generated from the following file: