Repository navigation
Adds --keyword argument to filter environments in list_envs.py - #3384
Conversation
|
This is a nice feature!!! Thank you @louislelay |
|
Thanks @ooctipus! :) |
There was a problem hiding this comment.
Greptile Overview
Greptile Summary
This PR adds an optional --keyword argument to the list_envs.py script, enabling users to filter the displayed environments by a search term. The implementation adds argument parsing before AppLauncher initialization and modifies the environment iteration loop to check if the keyword exists in the environment ID. When no keyword is provided, all environments are displayed as before, maintaining backward compatibility. The corresponding documentation has been updated in environments.rst to explain the new filtering option for both Linux and Windows users.
Important Files Changed
| Filename | Score | Overview |
|---|---|---|
| scripts/environments/list_envs.py | 5/5 | Adds --keyword argument parsing and implements filtering logic to show only environments matching the search term |
| docs/source/overview/environments.rst | 5/5 | Documents the new --keyword option with usage examples for both Linux and Windows platforms |
Confidence score: 5/5
- This PR is safe to merge with minimal risk
- Score reflects simple, well-scoped implementation with no breaking changes, proper documentation, and straightforward filtering logic using standard argparse and string matching
- No files require special attention
Sequence Diagram
sequenceDiagram
participant User
participant ArgParser
participant AppLauncher
participant Gym
participant PrettyTable
User->>ArgParser: "Run script with --keyword <search_term>"
ArgParser->>ArgParser: "Parse --keyword argument"
ArgParser->>AppLauncher: "Launch headless simulation app"
AppLauncher->>AppLauncher: "Initialize Isaac Sim"
User->>Gym: "Access gym.registry.values()"
loop For each task_spec in registry
Gym->>Gym: "Check if 'Isaac' in task_spec.id"
alt Keyword provided
Gym->>Gym: "Check if keyword in task_spec.id"
alt Matches filter
Gym->>PrettyTable: "Add row with task details"
end
else No keyword
Gym->>PrettyTable: "Add row with task details"
end
end
PrettyTable->>User: "Print formatted table of environments"
AppLauncher->>AppLauncher: "Close simulation app"
2 files reviewed, 2 comments
| # acquire all Isaac environments names | ||
| for task_spec in gym.registry.values(): | ||
| if "Isaac" in task_spec.id: | ||
| if "Isaac" in task_spec.id and (args_cli.keyword is None or args_cli.keyword in task_spec.id): |
There was a problem hiding this comment.
style: Keyword filtering is case-sensitive. Consider using .lower() for case-insensitive matching (e.g., args_cli.keyword.lower() in task_spec.id.lower()) to improve user experience.
| .. code:: batch | ||
|
|
||
| isaaclab.bat -p scripts\environments\list_envs.py | ||
| isaaclab.bat -p scripts\environments\list_envs.py --keyword <search_term> |
There was a problem hiding this comment.
syntax: Windows uses backslashes for path separators - the --keyword flag needs a space not a backslash before it
|
Thank you for the MR! Slowly for the slow response on our side. |
|
No worries @Mayankm96, thanks for merging it! |
…-sim#3384) # Description This PR introduces an optional `--keyword <search_term>` argument to the `list_envs.py` script. It allows filtering the list of environments by keyword, making it easier to quickly find relevant tasks. ## Type of change - New feature (non-breaking change which adds functionality) - This change requires a documentation update ## Screenshots Searching for all Franka envs: <img width="2494" height="1408" alt="Screenshot from 2025-09-08 13-39-32" src="https://github.com/user-attachments/assets/763c22e5-0f31-4cc1-9d0d-1930e53453ab" /> ## Checklist - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./isaaclab.sh --format` - [x] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] I have updated the changelog and the corresponding version in the extension's `config/extension.toml` file - [x] I have added my name to the `CONTRIBUTORS.md` or my name already exists there --------- Signed-off-by: Louis LE LAY <[email protected]> Co-authored-by: Mayank Mittal <[email protected]> Co-authored-by: ooctipus <[email protected]>
…-sim#3384) # Description This PR introduces an optional `--keyword <search_term>` argument to the `list_envs.py` script. It allows filtering the list of environments by keyword, making it easier to quickly find relevant tasks. ## Type of change - New feature (non-breaking change which adds functionality) - This change requires a documentation update ## Screenshots Searching for all Franka envs: <img width="2494" height="1408" alt="Screenshot from 2025-09-08 13-39-32" src="https://github.com/user-attachments/assets/763c22e5-0f31-4cc1-9d0d-1930e53453ab" /> ## Checklist - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./isaaclab.sh --format` - [x] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] I have updated the changelog and the corresponding version in the extension's `config/extension.toml` file - [x] I have added my name to the `CONTRIBUTORS.md` or my name already exists there --------- Signed-off-by: Louis LE LAY <[email protected]> Co-authored-by: Mayank Mittal <[email protected]> Co-authored-by: ooctipus <[email protected]>
…-sim#3384) # Description This PR introduces an optional `--keyword <search_term>` argument to the `list_envs.py` script. It allows filtering the list of environments by keyword, making it easier to quickly find relevant tasks. ## Type of change - New feature (non-breaking change which adds functionality) - This change requires a documentation update ## Screenshots Searching for all Franka envs: <img width="2494" height="1408" alt="Screenshot from 2025-09-08 13-39-32" src="https://github.com/user-attachments/assets/763c22e5-0f31-4cc1-9d0d-1930e53453ab" /> ## Checklist - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./isaaclab.sh --format` - [x] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] I have updated the changelog and the corresponding version in the extension's `config/extension.toml` file - [x] I have added my name to the `CONTRIBUTORS.md` or my name already exists there --------- Signed-off-by: Louis LE LAY <[email protected]> Co-authored-by: Mayank Mittal <[email protected]> Co-authored-by: ooctipus <[email protected]>
…-sim#3384) # Description This PR introduces an optional `--keyword <search_term>` argument to the `list_envs.py` script. It allows filtering the list of environments by keyword, making it easier to quickly find relevant tasks. ## Type of change - New feature (non-breaking change which adds functionality) - This change requires a documentation update ## Screenshots Searching for all Franka envs: <img width="2494" height="1408" alt="Screenshot from 2025-09-08 13-39-32" src="https://github.com/user-attachments/assets/763c22e5-0f31-4cc1-9d0d-1930e53453ab" /> ## Checklist - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./isaaclab.sh --format` - [x] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] I have updated the changelog and the corresponding version in the extension's `config/extension.toml` file - [x] I have added my name to the `CONTRIBUTORS.md` or my name already exists there --------- Signed-off-by: Louis LE LAY <[email protected]> Co-authored-by: Mayank Mittal <[email protected]> Co-authored-by: ooctipus <[email protected]>
Description
This PR introduces an optional
--keyword <search_term>argument to thelist_envs.pyscript. It allows filtering the list of environments by keyword, making it easier to quickly find relevant tasks.Type of change
Screenshots
Searching for all Franka envs:
Checklist
pre-commitchecks with./isaaclab.sh --formatconfig/extension.tomlfileCONTRIBUTORS.mdor my name already exists there