You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As mentioned by @cdeil in #5586, figuring out exactly where a warning was emitted is often tricky. The base AstropyWarning class seems to make this even worse by entirely suppressing line/file information in the output in favor of a cleaner display.
One thing that can help is including an appropriate stacklevel kwarg in the warn call, where this refers to the number of stack levels up where one expects the original user call. Granted that is not always predictable, but in many cases it is and would then allow users to see where in their code the warning originated. An example is in #5586 where stacklevel=3 always gets back to the user call.
The text was updated successfully, but these errors were encountered:
As mentioned by @cdeil in #5586, figuring out exactly where a warning was emitted is often tricky. The base
AstropyWarning
class seems to make this even worse by entirely suppressing line/file information in the output in favor of a cleaner display.One thing that can help is including an appropriate
stacklevel
kwarg in thewarn
call, where this refers to the number of stack levels up where one expects the original user call. Granted that is not always predictable, but in many cases it is and would then allow users to see where in their code the warning originated. An example is in #5586 where stacklevel=3 always gets back to the user call.The text was updated successfully, but these errors were encountered: