Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filterwarning in under-review decorator #952

Open
braun-steven opened this issue Dec 8, 2022 · 2 comments
Open

Filterwarning in under-review decorator #952

braun-steven opened this issue Dec 8, 2022 · 2 comments
Labels
bug Something isn't working won't fix This will not be worked on

Comments

@braun-steven
Copy link

braun-steven commented Dec 8, 2022

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
Copy link

stale bot commented Mar 18, 2023

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.

@stale stale bot added the won't fix This will not be worked on label Mar 18, 2023
@Borda Borda added fix fixing issues... bug Something isn't working and removed fix fixing issues... labels Jun 20, 2023
@Borda
Copy link
Member

Borda commented Jun 30, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working won't fix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants