From 92b86ee4f6e635362663ac35fc4405f3f29f4452 Mon Sep 17 00:00:00 2001 From: Jim Bosch Date: Wed, 10 Jul 2024 10:18:11 -0400 Subject: [PATCH] Deprecate RFC-834 transition helpers. --- python/lsst/daf/butler/dimensions/_group.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/python/lsst/daf/butler/dimensions/_group.py b/python/lsst/daf/butler/dimensions/_group.py index 4e0963f51d..eee6d9cec0 100644 --- a/python/lsst/daf/butler/dimensions/_group.py +++ b/python/lsst/daf/butler/dimensions/_group.py @@ -35,6 +35,7 @@ from typing import TYPE_CHECKING, Any, TypeAlias import pydantic +from deprecated.sphinx import deprecated from lsst.utils.classes import cached_getter, immutable from pydantic_core import core_schema @@ -101,7 +102,13 @@ def as_tuple(self) -> tuple[str, ...]: """ return self._seq + # TODO: remove on DM-45185 @property + @deprecated( + "Deprecated in favor of direct iteration over the parent set. Will be removed after v28.", + version="v28", + category=FutureWarning, + ) def names(self) -> Set[str]: """An alias to ``self``. @@ -265,6 +272,12 @@ def __str__(self) -> str: def __repr__(self) -> str: return f"DimensionGroup({self.names})" + # TODO: remove on DM-45185 + @deprecated( + "Deprecated as no longer necessary (this method always returns 'self'). Will be removed after v28.", + version="v28", + category=FutureWarning, + ) def as_group(self) -> DimensionGroup: """Return ``self``.