Coverage for python/lsst/daf/butler/registry/dimensions/skypix.py : 89%

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/>.
"""A storage implementation specialized for `SkyPixDimension` records.
`SkyPixDimension` records are never stored in a database, but are instead generated-on-the-fly from a `sphgeom.Pixelization` instance.
Parameters ---------- dimension : `SkyPixDimension` The dimension for which this instance will simulate storage. """
context: Optional[StaticTablesContext] = None) -> DimensionRecordStorage: # Docstring inherited from DimensionRecordStorage.
def element(self) -> DimensionElement: # Docstring inherited from DimensionRecordStorage.element.
# Docstring inherited from DimensionRecordStorage.clearCaches.
self, builder: QueryBuilder, *, regions: Optional[NamedKeyDict[DimensionElement, sqlalchemy.sql.ColumnElement]] = None, timespans: Optional[NamedKeyDict[DimensionElement, Timespan[sqlalchemy.sql.ColumnElement]]] = None, ): # If joining some other element or dataset type already brought in # the key for this dimension, there's nothing left to do, because # a SkyPix dimension never has metadata or implied dependencies, # and its regions are never stored in the database. This code path # is the usual case for the storage instance that manages # ``DimensionUniverse.commonSkyPix`` instance, which has no table # of its own but many overlap tables. # Storage instances for other skypix dimensions will probably hit # the error below, but we don't currently have a use case for # joining them in anyway. raise NotImplementedError(f"Cannot includeSkyPix dimension {self.element.name} directly in query.")
# Docstring inherited from DimensionRecordStorage.insert. raise TypeError(f"Cannot insert into SkyPix dimension {self._dimension.name}.")
# Docstring inherited from DimensionRecordStorage.fetch. self._dimension.pixelization.pixel(dataId[self._dimension.name])) |