Formatter¶
-
class
lsst.daf.butler.
Formatter
¶ Bases:
object
Interface for reading and writing Datasets with a particular
StorageClass
.Attributes Summary
unsupportedParameters
Set of parameters not understood by this Formatter
.Methods Summary
name
()Returns the fully qualified name of the formatter. predictPath
(location)Return the path that would be returned by write, without actually writing. read
(fileDescriptor[, component])Read a Dataset. segregateParameters
(parameters)Segregate the supplied parameters into those understood by the formatter and those not understood by the formatter. write
(inMemoryDataset, fileDescriptor)Write a Dataset. Attributes Documentation
-
unsupportedParameters
= frozenset()¶ Set of parameters not understood by this
Formatter
. An empty set means all parameters are supported.None
indicates that no parameters are supported.
Methods Documentation
-
classmethod
name
()¶ Returns the fully qualified name of the formatter.
-
predictPath
(location)¶ Return the path that would be returned by write, without actually writing.
- location :
Location
- The location to simulate writing to.
- location :
-
read
(fileDescriptor, component=None)¶ Read a Dataset.
Parameters: - fileDescriptor :
FileDescriptor
Identifies the file to read, type to read it into and parameters to be used for reading.
- component :
str
, optional Component to read from the file. Only used if the
StorageClass
for reading differed from theStorageClass
used to write the file.
Returns: - inMemoryDataset :
InMemoryDataset
The requested Dataset.
- fileDescriptor :
-
segregateParameters
(parameters)¶ Segregate the supplied parameters into those understood by the formatter and those not understood by the formatter.
Any unsupported parameters are assumed to be usable by associated assemblers.
Parameters: - parameters :
dict
Parameters with values that have been supplied by the caller and which might be relevant for the formatter.
Returns: - parameters :
-
write
(inMemoryDataset, fileDescriptor)¶ Write a Dataset.
Parameters: - inMemoryDataset :
InMemoryDataset
The Dataset to store.
- fileDescriptor :
FileDescriptor
Identifies the file to write.
Returns: - path :
str
The path to where the Dataset was stored.
- inMemoryDataset :
-