Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-40057: shorten deprecation timeline and add ticket TODOs #868

Merged
merged 2 commits into from
Jul 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions python/lsst/daf/butler/_butler.py
Original file line number Diff line number Diff line change
Expand Up @@ -1109,12 +1109,13 @@ def _findDatasetRef(

return ref

# TODO: remove on DM-40067.
@transactional
@deprecated(
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,
)
Expand Down Expand Up @@ -1204,9 +1205,10 @@ 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 v27.0.",
" Please use Butler.get(). Will be removed after v26.0.",
version="v26.0",
category=FutureWarning,
)
Expand Down Expand Up @@ -1240,9 +1242,10 @@ 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 v27.0.",
"Please use Butler.getDeferred(). Will be removed after v26.0.",
version="v26.0",
category=FutureWarning,
)
Expand Down Expand Up @@ -1739,8 +1742,9 @@ def _exists_many(

return existence

# TODO: remove on DM-40079.
@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,
)
Expand Down
15 changes: 10 additions & 5 deletions python/lsst/daf/butler/_limited_butler.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,10 @@ 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 v27.0.",
" Please use Butler.put(). Will be removed after v26.0.",
version="v26.0",
category=FutureWarning,
)
Expand Down Expand Up @@ -164,9 +165,10 @@ 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 v27.0.",
" Please use Butler.get(). Will be removed after v26.0.",
version="v26.0",
category=FutureWarning,
)
Expand Down Expand Up @@ -200,9 +202,10 @@ 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 v27.0.",
"Please use Butler.getDeferred(). Will be removed after v26.0.",
version="v26.0",
category=FutureWarning,
)
Expand Down Expand Up @@ -443,9 +446,10 @@ 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 v27.0.",
"Will be removed after v26.0.",
version="v26.0",
category=FutureWarning,
)
Expand Down Expand Up @@ -542,10 +546,11 @@ 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 "
"relevant functionality. Will be removed after v27.0.",
"relevant functionality. Will be removed after v26.0.",
version="v26.0",
category=FutureWarning,
)
Expand Down
6 changes: 4 additions & 2 deletions python/lsst/daf/butler/_quantum_backed.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,9 +379,10 @@ 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 v27.0.",
" Please use Butler.get(). Will be removed after v26.0.",
version="v26.0",
category=FutureWarning,
)
Expand Down Expand Up @@ -418,9 +419,10 @@ 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 v27.0.",
"Please use Butler.getDeferred(). Will be removed after v26.0.",
version="v26.0",
category=FutureWarning,
)
Expand Down
2 changes: 1 addition & 1 deletion python/lsst/daf/butler/core/dimensions/_coordinate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down
4 changes: 2 additions & 2 deletions python/lsst/daf/butler/core/dimensions/_packer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down Expand Up @@ -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,
)
Expand Down
2 changes: 1 addition & 1 deletion python/lsst/daf/butler/core/dimensions/_universe.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down
6 changes: 4 additions & 2 deletions python/lsst/daf/butler/core/quantum.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,12 +392,14 @@ 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 v 27",
"The reconstitutedDimensions argument is now ignored and may be removed after v26",
category=FutureWarning,
stacklevel=find_outside_stacklevel("lsst.daf.butler"),
)
Expand Down
3 changes: 2 additions & 1 deletion python/lsst/daf/butler/instrument.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@
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 v27.",
"Deprecated in favor of configurable dimension packers. Will be removed after v26.",
version="v26",
category=FutureWarning,
)
Expand Down