Skip to content

Commit

Permalink
Add stacklevel parameter to the warnings
Browse files Browse the repository at this point in the history
This makes them come from the code that called the run method
with expIdBits.
  • Loading branch information
timj committed Jul 28, 2023
1 parent 411fad2 commit 6fb36c3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions python/lsst/ap/association/diaForcedSource.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ def run(self,
warnings.warn(
"'expIdBits' argument is deprecated in favor of 'idGenerator'; will be removed after v26.",
category=FutureWarning,
stacklevel=3, # Caller + timeMethod
)

if idGenerator is None:
Expand Down
1 change: 1 addition & 0 deletions python/lsst/ap/association/packageAlerts.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ def run(self,
warnings.warn(
"The 'ccdExposureIdBits' argument is deprecated and unused; it will be removed after v26.",
category=FutureWarning,
stacklevel=3, # Caller + timeMethod
)
alerts = []
self._patchDiaSources(diaSourceCat)
Expand Down

0 comments on commit 6fb36c3

Please sign in to comment.