Coverage for python / lsst / cell_coadds / typing_helpers.py: 76%
29 statements
« prev ^ index » next coverage.py v7.13.5, created at 2026-04-15 00:10 +0000
« prev ^ index » next coverage.py v7.13.5, created at 2026-04-15 00:10 +0000
1# This file is part of cell_coadds.
2#
3# Developed for the LSST Data Management System.
4# This product includes software developed by the LSST Project
5# (https://www.lsst.org).
6# See the COPYRIGHT file at the top-level directory of this distribution
7# for details of code ownership.
8#
9# This program is free software: you can redistribute it and/or modify
10# it under the terms of the GNU General Public License as published by
11# the Free Software Foundation, either version 3 of the License, or
12# (at your option) any later version.
13#
14# This program is distributed in the hope that it will be useful,
15# but WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17# GNU General Public License for more details.
18#
19# You should have received a copy of the GNU General Public License
20# along with this program. If not, see <https://www.gnu.org/licenses/>.
22"""Collection of type hint stubs for use in type checking."""
25from __future__ import annotations
27from collections.abc import Mapping
28from typing import Protocol, Self, overload
30import numpy as np
31from frozendict import frozendict
33from lsst.geom import Box2I, Point2I
35from ._stitched_aperture_correction import StitchedApertureCorrection
38class ImageLike(Protocol):
39 """Interface for objects that behave like `lsst.afw.image.Image` with
40 respect to subimage slicing, bounding box access, and XY0 offset.
41 """
43 @overload
44 def __getitem__(self, slices: tuple[slice, slice]) -> Self:
45 pass
47 @overload
48 def __getitem__(self, bbox: Box2I) -> Self:
49 pass
51 def __setitem__(self, bbox: Box2I, other: Self | int) -> None: # noqa: D105
52 pass
54 def getBBox(self) -> Box2I: # noqa: D102
55 pass
57 def getXY0(self) -> Point2I: # noqa: D102
58 pass
60 def setXY0(self, xy0: Point2I) -> None: # noqa: D102
61 pass
63 @property
64 def array(self) -> np.ndarray: # noqa: D102
65 pass
68type SingleCellCoaddApCorrMap = frozendict[str, float]
69"""A type alias for aperture correction maps for single cell coadds."""
71type StitchedCoaddApCorrMap = Mapping[str, StitchedApertureCorrection]
72"""A type alias for aperture correction maps for stitched coadds."""