Some code in my package is generating the below warning. (Actually I think it’s probably 10-20 places). Presumably this is how I’m supposed to learn that I have to update my code. How do I get a list of the problematic call sites? (meaning, which lines in my package are causing these warnings, as opposed to the code in MTK which generates the warning)
┌ Warning: `ODEProblem(sys, u0, tspan, p; kw...)` is deprecated. Use
│ `ODEProblem(sys, merge(u0, p), tspan)` instead.
└ @ ModelingToolkit ~/.julia/packages/ModelingToolkit/xkwpH/src/deprecations.jl:34
(For reference, I asked two strong AIs, and got two wrong answers. Specifically, running Julia with --depwarn=error or --depwarn=yes seemed to have no effect.)
Not about warnings in general, but deprecation warnings are specifically about API, so if the deprecated call is really not written in a dependency (in which case it’s their fault, not yours), then a plain text search of "ODEProblem(" can identify the files and line numbers with your calls and you can make the changes accordingly.
Since you said this happens in several places, you probably don’t want to turn warnings into runtime errors that you’d have to encounter and fix one at a time. It would be nice for a logger to store stack traces for warnings.
These are all nice ideas, but I would love to help future Julia users. I would like to add a feature request somewhere so that warnings do something a little smarter (like a global option to show full stacktrade, and the short version hints at it.) I don’t even know where to ask? Is this Julia base? Is it in MTK? Is it actually one of the logging packages? (Obviously this will be low priority, but should probably be on a feature queue somewhere.) Any ideas?
The second issue has some discussion about the performance downsides of that particular solution, but the first issue hasn’t been active for a long while and is perhaps worth reviving.