-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Replaces set_carb_setting and get_carb_setting with direct carb calls
#3922
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: main
Are you sure you want to change the base?
Conversation
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.
Greptile Overview
Greptile Summary
Replaces wrapper functions set_carb_setting and get_carb_setting from isaacsim.core.utils.carb with direct carb API calls to remove the dependency. The changes systematically replace the generic wrapper with type-specific methods (set_bool, set_int, set_float, set_string) and direct get() calls.
Key Changes:
- Removed imports of
set_carb_settingandget_carb_settingfrom 8 files - Added explicit type checking using
isinstance()to determine which type-specific setter to use - Replaced
get_carb_setting(settings, key)withsettings.get(key) - Type checking order is correct (bool before int, since bool is a subclass of int in Python)
Issue Found:
- Two additional files still use the deprecated imports but were not updated in this PR:
source/isaaclab/isaaclab/sim/utils.py(usesget_carb_setting)scripts/tools/check_instanceable.py(usesset_carb_setting)
Confidence Score: 3/5
- Safe to merge but incomplete - two files still use the deprecated imports
- The refactoring is technically sound with proper type checking and correct implementation. However, the migration is incomplete as two files still import and use the deprecated carb utility functions that this PR aims to remove. This creates an inconsistent state where some code uses the new approach while other code still depends on the old utilities.
- Pay attention to
source/isaaclab/isaaclab/sim/utils.pyandscripts/tools/check_instanceable.pywhich still use deprecated imports
Important Files Changed
File Analysis
| Filename | Score | Overview |
|---|---|---|
| source/isaaclab/isaaclab/sim/simulation_context.py | 4/5 | Replaced carb utils with direct API calls and added type-specific setter methods with proper type checking order |
| source/isaaclab/isaaclab/app/app_launcher.py | 5/5 | Simple replacement of set_carb_setting with type-specific carb API calls for rendering and animation recording |
Sequence Diagram
sequenceDiagram
participant App as AppLauncher
participant Sim as SimulationContext
participant Carb as carb.settings
Note over App,Carb: Before: Using wrapper functions
App->>Carb: set_carb_setting(settings, key, value)
Note over Carb: Type inference in wrapper
Carb-->>App: Setting applied
Note over App,Carb: After: Direct API calls
App->>App: Check isinstance(value, bool/int/float/str)
App->>Carb: settings.set_bool/set_int/set_float/set_string(key, value)
Carb-->>App: Setting applied
Sim->>Sim: _apply_render_settings_from_cfg()
Sim->>Sim: Type check preset values
Sim->>Carb: settings.set_bool/set_int/set_float/set_string(key, value)
Carb-->>Sim: Setting applied
Note over Sim: Uses settings.get() instead of get_carb_setting()
Sim->>Carb: settings.get(key)
Carb-->>Sim: Return value
8 files reviewed, 1 comment
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.
Greptile Overview
Greptile Summary
Replaced deprecated set_carb_setting and get_carb_setting utility functions with direct carb API calls throughout the codebase.
- Removed dependency on
isaacsim.core.utils.carb - Updated all call sites to use type-specific carb methods (
set_bool,set_int,set_float,set_string,get) - Added type detection logic in
simulation_context.pyto correctly route dynamic values to appropriate setter methods - Type checking correctly handles bool before int (since bool is subclass of int in Python)
Confidence Score: 4/5
- Safe to merge after addressing two remaining files that still use deprecated imports
- The changes are straightforward and correctly implemented, but the PR is incomplete as two files (
source/isaaclab/isaaclab/sim/utils.pyandscripts/tools/check_instanceable.py) still import and use the deprecated carb utility functions. These must be updated for consistency. source/isaaclab/isaaclab/sim/utils.pyandscripts/tools/check_instanceable.pystill use deprecated functions and must be updated
Important Files Changed
File Analysis
| Filename | Score | Overview |
|---|---|---|
| source/isaaclab/isaaclab/app/app_launcher.py | 5/5 | Removed deprecated carb utility imports and replaced with direct carb API calls using appropriate type-specific methods (set_string, set_bool, set_float). |
| source/isaaclab/isaaclab/sim/simulation_context.py | 5/5 | Replaced deprecated carb utility functions with direct carb API calls. Added type checking logic to route values to appropriate set_bool/set_int/set_float/set_string methods. Boolean check correctly precedes int check. |
Sequence Diagram
sequenceDiagram
participant App as AppLauncher/SimulationContext
participant Old as isaacsim.core.utils.carb
participant Carb as carb.settings
Note over App,Carb: Before (Deprecated Pattern)
App->>Old: set_carb_setting(settings, key, value)
Old->>Carb: Auto-detect type & call appropriate setter
Note over App,Carb: After (Direct API Pattern)
App->>App: Type check (bool/int/float/str)
App->>Carb: set_bool(key, value)
App->>Carb: set_int(key, value)
App->>Carb: set_float(key, value)
App->>Carb: set_string(key, value)
Note over App,Carb: Getter Pattern
App->>Carb: get(key)
Carb-->>App: value
8 files reviewed, no comments
5b00942 to
4eaaf6b
Compare
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.
Greptile Overview
Greptile Summary
This PR removes dependency on deprecated isaacsim.core.utils.carb utilities by replacing wrapper functions with direct carb API calls.
Key changes:
- Replaced
set_carb_setting(settings, key, value)with type-specific methods:settings.set_bool(),settings.set_int(),settings.set_float(),settings.set_string() - Replaced
get_carb_setting(settings, key)with directsettings.get(key)calls - Added type dispatch logic in
simulation_context.pyto handle dynamic value types from config files (lines 733-742, 755-764, 776-785) - Properly checks
isinstance(value, bool)beforeisinstance(value, int)to avoid Python's bool-as-int type hierarchy issue
Issues found:
- Two files still use the deprecated utilities and weren't updated:
source/isaaclab/isaaclab/sim/utils.py:23,1075andscripts/tools/check_instanceable.py:70,99
Confidence Score: 3/5
- PR is mostly safe but incomplete - two files still use deprecated utilities
- The refactoring is technically correct with proper type handling, but the migration is incomplete. Two files (
sim/utils.pyandscripts/tools/check_instanceable.py) still import and use the deprecated functions, which undermines the goal of removing this dependency - Pay attention to
source/isaaclab/isaaclab/sim/utils.pyandscripts/tools/check_instanceable.pywhich still use deprecated utilities
Important Files Changed
File Analysis
| Filename | Score | Overview |
|---|---|---|
| source/isaaclab/isaaclab/app/app_launcher.py | 5/5 | Replaced set_carb_setting with type-specific carb API calls (set_string, set_bool, set_float) - straightforward migration with correct types |
| source/isaaclab/isaaclab/sim/simulation_context.py | 4/5 | Replaced get_carb_setting and set_carb_setting with direct carb calls, added type dispatch logic for handling different value types - complex changes with proper bool-before-int checking |
Sequence Diagram
sequenceDiagram
participant Code as Application Code
participant OldAPI as isaacsim.core.utils.carb
participant CarbSettings as carb.settings
Note over Code,CarbSettings: Before (Deprecated Approach)
Code->>OldAPI: set_carb_setting(settings, key, value)
OldAPI->>CarbSettings: Infers type and calls appropriate method
Note over Code,CarbSettings: After (Direct API Calls)
Code->>Code: Check value type (bool/int/float/str)
alt bool value
Code->>CarbSettings: settings.set_bool(key, value)
else int value
Code->>CarbSettings: settings.set_int(key, value)
else float value
Code->>CarbSettings: settings.set_float(key, value)
else string value
Code->>CarbSettings: settings.set_string(key, value)
end
Note over Code,CarbSettings: Read Operations
Code->>CarbSettings: settings.get(key)
CarbSettings-->>Code: Returns value
8 files reviewed, no comments
4eaaf6b to
c80d57e
Compare
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.
Greptile Overview
Greptile Summary
Removes dependency on isaacsim.core.utils.carb helper functions by replacing set_carb_setting() and get_carb_setting() with direct carb API calls.
Key changes:
- Modified
set_setting()method to route values through typed carb setters (set_bool,set_int,set_float,set_string) based on Python type inspection - Updated
get_setting()to usecarb_settings.get()directly - Replaced all 14 call sites in
simulation_context.pyto use the updated methods - Type checking order is correct (bool before int, since bool is a subclass of int)
Note: A previous comment correctly identified that two other files (source/isaaclab/isaaclab/sim/utils.py:1075 and scripts/tools/check_instanceable.py:99) still use the deprecated carb utils and weren't updated in this PR.
Confidence Score: 5/5
- This PR is safe to merge - it's a straightforward refactoring that removes a dependency on deprecated helper functions
- The implementation correctly uses typed carb setters with proper type checking order (bool before int is critical since bool is a subclass of int in Python). All call sites in simulation_context.py were updated consistently. The refactoring maintains the same functionality while removing the intermediate helper layer.
- No files in this PR require special attention, though note that other files in the codebase still use the deprecated utilities (already flagged in previous comments)
Important Files Changed
File Analysis
| Filename | Score | Overview |
|---|---|---|
| source/isaaclab/isaaclab/sim/simulation_context.py | 5/5 | Replaced deprecated set_carb_setting/get_carb_setting helper functions with direct carb API calls using typed setters (set_bool, set_int, set_float, set_string) and get(). Implementation is correct with proper type checking order (bool before int). |
Sequence Diagram
sequenceDiagram
participant Caller
participant SimulationContext
participant TypeChecker
participant CarbSettings
Note over Caller,CarbSettings: Before (using deprecated helpers)
Caller->>SimulationContext: set_setting(name, value)
SimulationContext->>CarbSettings: set_carb_setting(settings, name, value)
CarbSettings->>CarbSettings: set(name, value)
Note over Caller,CarbSettings: After (direct carb API)
Caller->>SimulationContext: set_setting(name, value)
SimulationContext->>TypeChecker: isinstance checks
TypeChecker-->>SimulationContext: type determined
alt value is bool
SimulationContext->>CarbSettings: set_bool(name, value)
else value is int
SimulationContext->>CarbSettings: set_int(name, value)
else value is float
SimulationContext->>CarbSettings: set_float(name, value)
else value is str
SimulationContext->>CarbSettings: set_string(name, value)
else unsupported type
SimulationContext-->>Caller: ValueError
end
Note over Caller,CarbSettings: Get setting flow
Caller->>SimulationContext: get_setting(name)
SimulationContext->>CarbSettings: get(name)
CarbSettings-->>Caller: value
1 file reviewed, no comments
c80d57e to
ec8a841
Compare
Greptile OverviewGreptile SummaryThis PR successfully removes the dependency on deprecated Key Changes:
Note: As previously flagged, two files outside this PR still use the deprecated functions and should be updated:
Confidence Score: 4/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant App as Application Code
participant Old as isaacsim.core.utils.carb
participant New as carb.settings
participant Carb as Carbonite Settings
Note over App,Carb: Before (Deprecated)
App->>Old: set_carb_setting(settings, name, value)
Old->>Carb: settings.set(name, value)
App->>Old: get_carb_setting(settings, name)
Old->>Carb: settings.get(name)
Carb-->>Old: value
Old-->>App: value
Note over App,Carb: After (Direct API)
App->>New: settings.set_bool(name, value)
New->>Carb: Set boolean setting
App->>New: settings.set_int(name, value)
New->>Carb: Set integer setting
App->>New: settings.set_float(name, value)
New->>Carb: Set float setting
App->>New: settings.set_string(name, value)
New->>Carb: Set string setting
App->>New: settings.get(name)
New->>Carb: Get setting
Carb-->>New: value
New-->>App: value
|
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.
8 files reviewed, no comments
ec8a841 to
54d523e
Compare
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.
8 files reviewed, no comments
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.
8 files reviewed, no comments
Description
Removes dependency on
Replaces
set_carb_setting(carb_settings, <setting-name>, <setting-value>with direct carb callcarb_settings.set_string(<setting-name>, <setting-value>),...set_int...,...set_bool...,...set_float.... And replacesget_carb_settingwithcarb_settings.get()Type of change
Checklist
pre-commitchecks with./isaaclab.sh --formatconfig/extension.tomlfileCONTRIBUTORS.mdor my name already exists there