Skip to content

Commit 6fb36c3

Browse files
committed
Add stacklevel parameter to the warnings
This makes them come from the code that called the run method with expIdBits.
1 parent 411fad2 commit 6fb36c3

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

python/lsst/ap/association/diaForcedSource.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ def run(self,
135135
warnings.warn(
136136
"'expIdBits' argument is deprecated in favor of 'idGenerator'; will be removed after v26.",
137137
category=FutureWarning,
138+
stacklevel=3, # Caller + timeMethod
138139
)
139140

140141
if idGenerator is None:

python/lsst/ap/association/packageAlerts.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ def run(self,
119119
warnings.warn(
120120
"The 'ccdExposureIdBits' argument is deprecated and unused; it will be removed after v26.",
121121
category=FutureWarning,
122+
stacklevel=3, # Caller + timeMethod
122123
)
123124
alerts = []
124125
self._patchDiaSources(diaSourceCat)

0 commit comments

Comments
 (0)