Warning formats
Currently, ketos issues UserWarnings like this,
import warnings
x = 9
warnings.warn(f"This is my warning {x}", category=UserWarning)
Resulting in output like this,
/home/oliskir/tmp/test.py:3: UserWarning: This is my warning 9
warnings.warn(f"This is my warning {x}", category=UserWarning)
The warning gives the python file that triggered the warning, the line number, the (formatted) message, and finally also the line of code that issues the warning. Informative, but also difficuly to understand for non developers.
Since these warnings are intended for users (not developers), I would suggest that we adopt a much simpler format that only prints the warning message, and leaves out technical details about where within the code the warning came from.
So, something like this,
def ketos_user_warning_format(message, category, filename, lineno, file=None, line=None):
return '%s: %s\n' % (category.__name__, message)
warnings.formatwarning = ketos_user_warning_format
x = 9
warnings.warn(f"This is my warning {x}", category=UserWarning)
resulting in output like this,
UserWarning: This is my warning 9
@bpadovese , @fsfrazao , your thoughts?
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information