From 878f92d967b45bda919b36150a23e4b37fd96500 Mon Sep 17 00:00:00 2001 From: Jim Bosch Date: Tue, 18 Jul 2023 10:33:46 -0400 Subject: [PATCH 1/2] Shorten deprecation timelines per RFC-945. --- python/lsst/daf/butler/_butler.py | 8 ++++---- python/lsst/daf/butler/_limited_butler.py | 10 +++++----- python/lsst/daf/butler/_quantum_backed.py | 4 ++-- python/lsst/daf/butler/core/dimensions/_coordinate.py | 2 +- python/lsst/daf/butler/core/dimensions/_packer.py | 4 ++-- python/lsst/daf/butler/core/dimensions/_universe.py | 2 +- python/lsst/daf/butler/core/quantum.py | 2 +- python/lsst/daf/butler/instrument.py | 2 +- 8 files changed, 17 insertions(+), 17 deletions(-) diff --git a/python/lsst/daf/butler/_butler.py b/python/lsst/daf/butler/_butler.py index 36c90d3b4c..122ecee3a5 100644 --- a/python/lsst/daf/butler/_butler.py +++ b/python/lsst/daf/butler/_butler.py @@ -1114,7 +1114,7 @@ def _findDatasetRef( reason="Butler.put() now behaves like Butler.putDirect() when given a DatasetRef." " Please use Butler.put(). Be aware that you may need to adjust your usage if you" " were relying on the run parameter to determine the run." - " Will be removed after v27.0.", + " Will be removed after v26.0.", version="v26.0", category=FutureWarning, ) @@ -1206,7 +1206,7 @@ def put( @deprecated( reason="Butler.get() now behaves like Butler.getDirect() when given a DatasetRef." - " Please use Butler.get(). Will be removed after v27.0.", + " Please use Butler.get(). Will be removed after v26.0.", version="v26.0", category=FutureWarning, ) @@ -1242,7 +1242,7 @@ def getDirect( @deprecated( reason="Butler.getDeferred() now behaves like getDirectDeferred() when given a DatasetRef. " - "Please use Butler.getDeferred(). Will be removed after v27.0.", + "Please use Butler.getDeferred(). Will be removed after v26.0.", version="v26.0", category=FutureWarning, ) @@ -1740,7 +1740,7 @@ def _exists_many( return existence @deprecated( - reason="Butler.datasetExists() has been replaced by Butler.exists(). Will be removed after v27.0.", + reason="Butler.datasetExists() has been replaced by Butler.exists(). Will be removed after v26.0.", version="v26.0", category=FutureWarning, ) diff --git a/python/lsst/daf/butler/_limited_butler.py b/python/lsst/daf/butler/_limited_butler.py index 752f38cd4b..12697d777f 100644 --- a/python/lsst/daf/butler/_limited_butler.py +++ b/python/lsst/daf/butler/_limited_butler.py @@ -57,7 +57,7 @@ def isWriteable(self) -> bool: @deprecated( reason="Butler.put() now behaves like Butler.putDirect() when given a DatasetRef." - " Please use Butler.put(). Will be removed after v27.0.", + " Please use Butler.put(). Will be removed after v26.0.", version="v26.0", category=FutureWarning, ) @@ -166,7 +166,7 @@ def get( @deprecated( reason="Butler.get() now behaves like Butler.getDirect() when given a DatasetRef." - " Please use Butler.get(). Will be removed after v27.0.", + " Please use Butler.get(). Will be removed after v26.0.", version="v26.0", category=FutureWarning, ) @@ -202,7 +202,7 @@ def getDirect( @deprecated( reason="Butler.getDeferred() now behaves like getDirectDeferred() when given a DatasetRef. " - "Please use Butler.getDeferred(). Will be removed after v27.0.", + "Please use Butler.getDeferred(). Will be removed after v26.0.", version="v26.0", category=FutureWarning, ) @@ -445,7 +445,7 @@ def stored_many( @deprecated( reason="Butler.datasetExistsDirect() has been replaced by Butler.stored(). " - "Will be removed after v27.0.", + "Will be removed after v26.0.", version="v26.0", category=FutureWarning, ) @@ -545,7 +545,7 @@ def dimensions(self) -> DimensionUniverse: @property @deprecated( reason="The Butler.datastore property is now deprecated. Butler APIs should now exist with the " - "relevant functionality. Will be removed after v27.0.", + "relevant functionality. Will be removed after v26.0.", version="v26.0", category=FutureWarning, ) diff --git a/python/lsst/daf/butler/_quantum_backed.py b/python/lsst/daf/butler/_quantum_backed.py index a7f143d2a3..9f54f5cc56 100644 --- a/python/lsst/daf/butler/_quantum_backed.py +++ b/python/lsst/daf/butler/_quantum_backed.py @@ -381,7 +381,7 @@ def isWriteable(self) -> bool: @deprecated( reason="Butler.get() now behaves like Butler.getDirect() when given a DatasetRef." - " Please use Butler.get(). Will be removed after v27.0.", + " Please use Butler.get(). Will be removed after v26.0.", version="v26.0", category=FutureWarning, ) @@ -420,7 +420,7 @@ def get( @deprecated( reason="Butler.getDeferred() now behaves like getDirectDeferred() when given a DatasetRef. " - "Please use Butler.getDeferred(). Will be removed after v27.0.", + "Please use Butler.getDeferred(). Will be removed after v26.0.", version="v26.0", category=FutureWarning, ) diff --git a/python/lsst/daf/butler/core/dimensions/_coordinate.py b/python/lsst/daf/butler/core/dimensions/_coordinate.py index e914dfe085..945b12fefe 100644 --- a/python/lsst/daf/butler/core/dimensions/_coordinate.py +++ b/python/lsst/daf/butler/core/dimensions/_coordinate.py @@ -647,7 +647,7 @@ def pack(self, name: str, *, returnMaxBits: Literal[False]) -> int: # TODO: Remove this method and its overloads above on DM-38687. @deprecated( - "Deprecated in favor of configurable dimension packers. Will be removed after v27.", + "Deprecated in favor of configurable dimension packers. Will be removed after v26.", version="v26", category=FutureWarning, ) diff --git a/python/lsst/daf/butler/core/dimensions/_packer.py b/python/lsst/daf/butler/core/dimensions/_packer.py index 470ba7011d..1659e5d46b 100644 --- a/python/lsst/daf/butler/core/dimensions/_packer.py +++ b/python/lsst/daf/butler/core/dimensions/_packer.py @@ -177,7 +177,7 @@ def unpack(self, packedId: int) -> DataCoordinate: # TODO: Remove this class on DM-38687. @deprecated( - "Deprecated in favor of configurable dimension packers. Will be removed after v27.", + "Deprecated in favor of configurable dimension packers. Will be removed after v26.", version="v26", category=FutureWarning, ) @@ -244,7 +244,7 @@ def __call__(self, universe: DimensionUniverse, fixed: DataCoordinate) -> Dimens # TODO: Remove this class on DM-38687. @deprecated( - "Deprecated in favor of configurable dimension packers. Will be removed after v27.", + "Deprecated in favor of configurable dimension packers. Will be removed after v26.", version="v26", category=FutureWarning, ) diff --git a/python/lsst/daf/butler/core/dimensions/_universe.py b/python/lsst/daf/butler/core/dimensions/_universe.py index bd0d611669..0c35a1d4f6 100644 --- a/python/lsst/daf/butler/core/dimensions/_universe.py +++ b/python/lsst/daf/butler/core/dimensions/_universe.py @@ -449,7 +449,7 @@ def sorted(self, elements: Iterable[E | str], *, reverse: bool = False) -> list[ # TODO: Remove this method on DM-38687. @deprecated( - "Deprecated in favor of configurable dimension packers. Will be removed after v27.", + "Deprecated in favor of configurable dimension packers. Will be removed after v26.", version="v26", category=FutureWarning, ) diff --git a/python/lsst/daf/butler/core/quantum.py b/python/lsst/daf/butler/core/quantum.py index 21344f7ddd..795084cacf 100644 --- a/python/lsst/daf/butler/core/quantum.py +++ b/python/lsst/daf/butler/core/quantum.py @@ -397,7 +397,7 @@ def from_simple( initInputs: MutableMapping[DatasetType, DatasetRef] = {} if reconstitutedDimensions is not None: warnings.warn( - "The reconstitutedDimensions argument is now ignored and may be removed after v 27", + "The reconstitutedDimensions argument is now ignored and may be removed after v26", category=FutureWarning, stacklevel=find_outside_stacklevel("lsst.daf.butler"), ) diff --git a/python/lsst/daf/butler/instrument.py b/python/lsst/daf/butler/instrument.py index 7e51fb0a97..4a6b27d726 100644 --- a/python/lsst/daf/butler/instrument.py +++ b/python/lsst/daf/butler/instrument.py @@ -28,7 +28,7 @@ @deprecated( - "Deprecated in favor of configurable dimension packers. Will be removed after v27.", + "Deprecated in favor of configurable dimension packers. Will be removed after v26.", version="v26", category=FutureWarning, ) From 58f80da4952dc2610fc6c702e825dbea42d26378 Mon Sep 17 00:00:00 2001 From: Jim Bosch Date: Tue, 18 Jul 2023 11:04:27 -0400 Subject: [PATCH 2/2] Add more ticket TODOs for deprecations. --- python/lsst/daf/butler/_butler.py | 4 ++++ python/lsst/daf/butler/_limited_butler.py | 5 +++++ python/lsst/daf/butler/_quantum_backed.py | 2 ++ python/lsst/daf/butler/core/quantum.py | 4 +++- python/lsst/daf/butler/instrument.py | 1 + 5 files changed, 15 insertions(+), 1 deletion(-) diff --git a/python/lsst/daf/butler/_butler.py b/python/lsst/daf/butler/_butler.py index 122ecee3a5..5726d78a07 100644 --- a/python/lsst/daf/butler/_butler.py +++ b/python/lsst/daf/butler/_butler.py @@ -1109,6 +1109,7 @@ def _findDatasetRef( return ref + # TODO: remove on DM-40067. @transactional @deprecated( reason="Butler.put() now behaves like Butler.putDirect() when given a DatasetRef." @@ -1204,6 +1205,7 @@ def put( return ref + # TODO: remove on DM-40067. @deprecated( reason="Butler.get() now behaves like Butler.getDirect() when given a DatasetRef." " Please use Butler.get(). Will be removed after v26.0.", @@ -1240,6 +1242,7 @@ def getDirect( """ return self._datastore.get(ref, parameters=parameters, storageClass=storageClass) + # TODO: remove on DM-40067. @deprecated( reason="Butler.getDeferred() now behaves like getDirectDeferred() when given a DatasetRef. " "Please use Butler.getDeferred(). Will be removed after v26.0.", @@ -1739,6 +1742,7 @@ def _exists_many( return existence + # TODO: remove on DM-40079. @deprecated( reason="Butler.datasetExists() has been replaced by Butler.exists(). Will be removed after v26.0.", version="v26.0", diff --git a/python/lsst/daf/butler/_limited_butler.py b/python/lsst/daf/butler/_limited_butler.py index 12697d777f..f04d92221f 100644 --- a/python/lsst/daf/butler/_limited_butler.py +++ b/python/lsst/daf/butler/_limited_butler.py @@ -55,6 +55,7 @@ def isWriteable(self) -> bool: """Return `True` if this `Butler` supports write operations.""" raise NotImplementedError() + # TODO: remove on DM-40067. @deprecated( reason="Butler.put() now behaves like Butler.putDirect() when given a DatasetRef." " Please use Butler.put(). Will be removed after v26.0.", @@ -164,6 +165,7 @@ def get( log.debug("Butler get: %s, parameters=%s, storageClass: %s", ref, parameters, storageClass) return self._datastore.get(ref, parameters=parameters, storageClass=storageClass) + # TODO: remove on DM-40067. @deprecated( reason="Butler.get() now behaves like Butler.getDirect() when given a DatasetRef." " Please use Butler.get(). Will be removed after v26.0.", @@ -200,6 +202,7 @@ def getDirect( """ return self._datastore.get(ref, parameters=parameters, storageClass=storageClass) + # TODO: remove on DM-40067. @deprecated( reason="Butler.getDeferred() now behaves like getDirectDeferred() when given a DatasetRef. " "Please use Butler.getDeferred(). Will be removed after v26.0.", @@ -443,6 +446,7 @@ def stored_many( """ return self._datastore.mexists(refs) + # TODO: remove on DM-40079. @deprecated( reason="Butler.datasetExistsDirect() has been replaced by Butler.stored(). " "Will be removed after v26.0.", @@ -542,6 +546,7 @@ def dimensions(self) -> DimensionUniverse: """ raise NotImplementedError() + # TODO: remove on DM-40080. @property @deprecated( reason="The Butler.datastore property is now deprecated. Butler APIs should now exist with the " diff --git a/python/lsst/daf/butler/_quantum_backed.py b/python/lsst/daf/butler/_quantum_backed.py index 9f54f5cc56..dbdb331ebe 100644 --- a/python/lsst/daf/butler/_quantum_backed.py +++ b/python/lsst/daf/butler/_quantum_backed.py @@ -379,6 +379,7 @@ def isWriteable(self) -> bool: # Docstring inherited. return True + # TODO: remove on DM-40067. @deprecated( reason="Butler.get() now behaves like Butler.getDirect() when given a DatasetRef." " Please use Butler.get(). Will be removed after v26.0.", @@ -418,6 +419,7 @@ def get( self._available_inputs.add(ref.id) return obj + # TODO: remove on DM-40067. @deprecated( reason="Butler.getDeferred() now behaves like getDirectDeferred() when given a DatasetRef. " "Please use Butler.getDeferred(). Will be removed after v26.0.", diff --git a/python/lsst/daf/butler/core/quantum.py b/python/lsst/daf/butler/core/quantum.py index 795084cacf..ae323e72f5 100644 --- a/python/lsst/daf/butler/core/quantum.py +++ b/python/lsst/daf/butler/core/quantum.py @@ -392,10 +392,12 @@ def from_simple( required dimension has already been loaded. Otherwise the record will be unpersisted from the SerializedQuatnum and added to the reconstitutedDimensions dict (if not None). Defaults to None. - Deprecated, any argument will be ignored. + Deprecated, any argument will be ignored. Will be removed after + v26. """ initInputs: MutableMapping[DatasetType, DatasetRef] = {} if reconstitutedDimensions is not None: + # TODO: remove this argument on DM-40150. warnings.warn( "The reconstitutedDimensions argument is now ignored and may be removed after v26", category=FutureWarning, diff --git a/python/lsst/daf/butler/instrument.py b/python/lsst/daf/butler/instrument.py index 4a6b27d726..9c84b2b7fb 100644 --- a/python/lsst/daf/butler/instrument.py +++ b/python/lsst/daf/butler/instrument.py @@ -27,6 +27,7 @@ from lsst.daf.butler import DataCoordinate, DimensionGraph, DimensionPacker +# TODO: remove on DM-38687. @deprecated( "Deprecated in favor of configurable dimension packers. Will be removed after v26.", version="v26",