redflag
redflag copied to clipboard
Use `logging.warning()` instead of `warnings.warn()`
Not 100% sure which is the most idiomatic approach, or what the practical difference would be, so this is just a question for now.
Also wondering if I should make a clearer distinction between warnings about redfalg's operation and warnings about data ("red flags"), other than just using a :triangular_flag_on_post: emoji in the data warnings.
For example, could have a custom warning like:
class RedflagWarning(UserWarning):
def __init__(self, message):
self.message = message
def __str__(self):
return f"🚩 {self.message}"
Then do warnings like
warnings.warn(f"Feature {i} has a distribution that is different from training.", category=RedflagWarning)