Coverage for python/lsst/daf/butler/core/datasets.py : 96%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
# This file is part of daf_butler. # # Developed for the LSST Data Management System. # This product includes software developed by the LSST Project # (http://www.lsst.org). # See the COPYRIGHT file at the top-level directory of this distribution # for details of code ownership. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>.
data = {}
r"""A named category of Datasets that defines how they are organized, related, and stored.
A concrete, final class whose instances represent `DatasetType`\ s. `DatasetType` instances may be constructed without a `Registry`, but they must be registered via `Registry.registerDatasetType()` before corresponding Datasets may be added. `DatasetType` instances are immutable.
Parameters ---------- name : `str` A string name for the Dataset; must correspond to the same `DatasetType` across all Registries. dataUnits : `iterable` of `str` `DataUnit` names that defines the `DatasetRef`\ s corresponding to this `DatasetType`. The input iterable is copied into a `frozenset`. storageClass : `StorageClass` Instance of a `StorageClass` that defines how this `DatasetType` is persisted. """
def nameWithComponent(datasetTypeName, componentName): """Form a valid DatasetTypeName from a parent and component.
No validation is performed.
Parameters ---------- datasetTypeName : `str` Base type name. componentName : `str` Name of component.
Returns ------- compTypeName : `str` Name to use for component DatasetType. """
def name(self): """A string name for the Dataset; must correspond to the same `DatasetType` across all Registries. """
def dataUnits(self): """A `frozenset` of `DataUnit` names that defines the `DatasetRef`\ s corresponding to this `DatasetType`. """
def storageClass(self): """`StorageClass` instance that defines how this `DatasetType` is persisted. """
"""Component name (if defined)
Returns ------- comp : `str` Name of component part of DatasetType name. `None` if this `DatasetType` is not associated with a component. """
"""Given a component name, derive the datasetTypeName of that component
Parameters ---------- component : `str` Name of component
Returns ------- derived : `str` Compound name of this `DatasetType` and the component.
Raises ------ KeyError Requested component is not supported by this `DatasetType`. """ raise KeyError("Requested component ({}) not understood by this DatasetType".format(component))
"""Boolean indicating whether this `DatasetType` is a composite type.
Returns ------- isComposite : `bool` `True` if this `DatasetType` is a composite type, `False` otherwise. """
"""Names to use when looking up this datasetType in a configuration.
The names are returned in order of priority.
Returns ------- names : `tuple` of `str` Tuple of the `DatasetType` name and the `StorageClass` name. """
"""Reference to a Dataset in a `Registry`.
A `DatasetRef` may point to a Dataset that currently does not yet exist (e.g., because it is a predicted input for provenance).
Parameters ---------- datasetType : `DatasetType` The `DatasetType` for this Dataset. dataId : `dict` A `dict` of `DataUnit` link name, value pairs that label the `DatasetRef` within a Collection. id : `int`, optional A unique identifier. Normally set to `None` and assigned by `Registry` """
"_predictedConsumers", "_actualConsumers", "_components")
def id(self): """Primary key of the dataset (`int`)
Typically assigned by `Registry`. """
def datasetType(self): """The `DatasetType` associated with the Dataset the `DatasetRef` points to. """
def dataId(self): """A `dict` of `DataUnit` link name, value pairs that label the `DatasetRef` within a Collection. """
def producer(self): """The `Quantum` instance that produced (or will produce) the Dataset.
Read-only; update via `Registry.addDataset()`, `QuantumGraph.addDataset()`, or `Butler.put()`. May be `None` if no provenance information is available. """
def run(self): """The `Run` instance that produced (or will produce) the Dataset.
Read-only; update via `Registry.addDataset()` or `Butler.put()`. """
def predictedConsumers(self): """A sequence of `Quantum` instances that list this Dataset in their `predictedInputs` attributes.
Read-only; update via `Quantum.addPredictedInput()`. May be an empty list if no provenance information is available. """
def actualConsumers(self): """A sequence of `Quantum` instances that list this Dataset in their `actualInputs` attributes.
Read-only; update via `Registry.markInputUsed()`. May be an empty list if no provenance information is available. """
def components(self): """Named `DatasetRef` components.
Read-only; update via `Registry.attachComponent()`. """
self.id, self.dataId, components)
"""Obtain a new DatasetRef that is detached from the registry.
Its ``id`` property will be ``None``. This can be used for transfers and similar operations. """
"""Boolean indicating whether this `DatasetRef` is a composite type.
Returns ------- isComposite : `bool` `True` if this `DatasetRef` is a composite type, `False` otherwise. """
"""Names to use when looking up this DatasetRef in a configuration.
The names are returned in order of priority.
Returns ------- names : `tuple` of `str` Tuple of the `DatasetType` name and the `StorageClass` name. """ |