Lightning-Universe/lightning-bolts

Filterwarning in under-review decorator

braun-steven opened this issue · 2 comments

The custom filterwarning in the under-review decorator leads to global rules being overwritten:

https://github.com/Lightning-AI/lightning-bolts/blob/c26c8d8f407de386038d5fb13297233a8aa052e7/pl_bolts/utils/stability.py#L75

Due to this, the following will still print the warnings (multiple times):

import warnings

warnings.simplefilter("ignore")  # This should ignore all warnings
warnings.warn("test")  # "test" is ignored
import pl_bolts  # Raises multiple "UnderReviewWarning"
stale commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Borda commented

Yes we probably need to set the local scope for logging, would you be interested in sending PR and taking inspiration from: https://github.com/Lightning-AI/lightning/blob/5d7669af4606f9e20c66fd7e3cd26a5d730cc2cc/src/lightning/__init__.py#L5-L7