FormatterFactory

class lsst.daf.butler.FormatterFactory

Bases: object

Factory for Formatter instances.

Methods Summary

getFormatter(storageClass[, datasetType]) Get a new formatter instance.
registerFormatter(type_, formatter) Register a Formatter.

Methods Documentation

getFormatter(storageClass, datasetType=None)

Get a new formatter instance.

Parameters:
storageClass : StorageClass

Get Formatter associated with this StorageClass, unless.

datasetType : DatasetType or str, optional

If given, look if an override has been specified for this DatasetType and, if so return that instead.

registerFormatter(type_, formatter)

Register a Formatter.

Parameters:
type_ : str or StorageClass or DatasetType

Type for which this formatter is to be used.

formatter : str

Identifies a Formatter subclass to use for reading and writing Datasets of this type.

Raises:
ValueError

If formatter does not name a valid formatter type.