-
Notifications
You must be signed in to change notification settings - Fork 3k
Reduce warnings #4522
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
base: develop
Are you sure you want to change the base?
Reduce warnings #4522
Conversation
Greptile OverviewGreptile SummaryThis PR configures Python's warnings module to display Key changes:
Observations:
Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant Module as Module __init__.py
participant WarningsModule as Python warnings module
participant DeprecatedCode as Deprecated Code
User->>Module: Import isaaclab module
Module->>WarningsModule: warnings.filterwarnings("once", DeprecationWarning, module="isaaclab.*")
Module->>WarningsModule: warnings.filterwarnings("once", FutureWarning, module="isaaclab.*")
Note over WarningsModule: Configure filters to show warnings only once per session
User->>DeprecatedCode: Access deprecated property (1st time)
DeprecatedCode->>WarningsModule: warnings.warn(..., DeprecationWarning)
WarningsModule->>User: Display warning message
Note over WarningsModule: Record warning shown
User->>DeprecatedCode: Access same deprecated property (2nd time)
DeprecatedCode->>WarningsModule: warnings.warn(..., DeprecationWarning)
WarningsModule-->>User: Suppress warning (already shown)
Note over WarningsModule: Warning filtered out (once filter active)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
7 files reviewed, 7 comments
|
|
||
| # Configure deprecation warnings to show only once per session (regardless of call site) | ||
| # This prevents repeated warnings when deprecated properties are accessed from multiple locations | ||
| import warnings |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move import warnings to the top of the file with other imports (line 8-9) per PEP8 conventions
| import warnings | |
| import warnings |
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
|
|
||
| # Configure deprecation warnings to show only once per session (regardless of call site) | ||
| # This prevents repeated warnings when deprecated properties are accessed from multiple locations | ||
| import warnings |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move import warnings to the top of the file with other imports (line 7-8) per PEP8 conventions
| import warnings | |
| import warnings |
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| __version__ = ISAACLAB_CONTRIB_METADATA["package"]["version"] | ||
|
|
||
| # Configure deprecation warnings to show only once per session (regardless of call site) | ||
| # This prevents repeated warnings when deprecated properties are accessed from multiple locations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move import warnings to the top of the file with other imports (line 6-10) per PEP8 conventions
| # This prevents repeated warnings when deprecated properties are accessed from multiple locations | |
| import warnings |
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| __version__ = "1.0.0" | ||
|
|
||
| # Configure deprecation warnings to show only once per session (regardless of call site) | ||
| # This prevents repeated warnings when deprecated properties are accessed from multiple locations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add import warnings at the top of the file per PEP8 conventions
| # This prevents repeated warnings when deprecated properties are accessed from multiple locations | |
| import warnings |
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| __version__ = ISAACLAB_PHYSX_METADATA["package"]["version"] | ||
|
|
||
| # Configure deprecation warnings to show only once per session (regardless of call site) | ||
| # This prevents repeated warnings when deprecated properties are accessed from multiple locations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move import warnings to the top of the file with other imports (line 6-9) per PEP8 conventions
| # This prevents repeated warnings when deprecated properties are accessed from multiple locations | |
| import warnings |
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
|
|
||
| # Configure deprecation warnings to show only once per session (regardless of call site) | ||
| # This prevents repeated warnings when deprecated properties are accessed from multiple locations | ||
| import warnings |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add import warnings at the top of the file per PEP8 conventions
| import warnings | |
| import warnings |
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| __version__ = ISAACLAB_TASKS_METADATA["package"]["version"] | ||
|
|
||
| # Configure deprecation warnings to show only once per session (regardless of call site) | ||
| # This prevents repeated warnings when deprecated properties are accessed from multiple locations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move import warnings to the top of the file with other imports (line 6-10) per PEP8 conventions
| # This prevents repeated warnings when deprecated properties are accessed from multiple locations | |
| import warnings |
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Description
Warn only once. @pascal-roth I'm wondering if this should not be handled at the logger level.
Fixes # (issue)
Type of change
Checklist
pre-commitchecks with./isaaclab.sh --formatconfig/extension.tomlfileCONTRIBUTORS.mdor my name already exists there