Details
-
Type:
Story
-
Status: Done
-
Resolution: Done
-
Fix Version/s: None
-
Component/s: pipe_base
-
Labels:
-
Story Points:1
-
Epic Link:
-
Team:Ops Middleware
-
Urgent?:No
Description
In DM-40032 I modified the warnings in pipe_base so that the warning comes from the caller. Unfortunately this effectively broke the warning from deprecated connections because they are issued far away from any code that defines the warning itself.
You end up with things like:
drp_pipe/tests/test_pipelines.py:281: FutureWarning: Deprecated in favor of 'visitSummary'. Will be removed after v26.
|
since that is the first place outside of pipe_base. We need to decide what stacklevel to use but also ensure that the warning contains the name of the deprecated connection since otherwise people have no idea which connection they are being warned about.
Adding the connection name is straightforward and you get:
FutureWarning: finalVisitSummary: Deprecated in favor of 'visitSummary'. Will be removed after v26.
which is more information than we had before. What I really want to do is this:
finalVisitSummary (from lsst.pipe.tasks.makeWarp.MakeWarpConnections): Deprecated in favor of 'visitSummary'. Will be removed after v26.
since it tells you exactly which class the deprecated connection came from. Calculating this for every connection has a lot of overhead (one test in drp_pipe gets 4 times slower) but I'd like to calculate the connection class for the deprecated connections. It would give some overhead but hopefully we don't have hundreds of deprecated connections. I haven't quite been able to get this working in post-init yet.