yt-project/yt

Unit warnings and errors should reference locations higher on the stack

Open

#962 opened on Dec 18, 2014

View on GitHub
 (1 comment) (0 reactions) (0 assignees)Python (315 forks)auto 404
enhancementhelp wantedwishlist

Repository metrics

Stars
 (556 stars)
PR merge metrics
 (PR metrics pending)

Description

Originally reported by: Nathan Goldbaum (Bitbucket: ngoldbaum, GitHub: ngoldbaum)


Warnings like these aren't useful:

Untitled.png

These warnings are happening when we invoke numpy on the array data - normally these warnings would be issued wherever we are manipulating numpy arrays elsewhere, but since we access numpy indirectly via YTArray, the warnings show with references to yt_array.py.

We should be doing these superclass calls in try/except blocks to catch the warnings. If we detect a warning, we should manipulate it so the message reports a file and line number corresponding to a more useful place in the call stack.


Contributor guide