Skip to content

docs: fix swapped preserve_order descriptions in resolve_matching_names docstrings - #5546

Merged
kellyguo11 merged 1 commit into
isaac-sim:mainfrom
dashitongzhi:fix/docstring-preserve-order-swap
May 28, 2026
Merged

kellyguo11 merged 1 commit into
isaac-sim:mainfrom
dashitongzhi:fix/docstring-preserve-order-swap

Conversation

@dashitongzhi

Copy link
Copy Markdown
Contributor

Description

Fixes #5146

The docstrings for both resolve_matching_names and resolve_matching_names_values in source/isaaclab/isaaclab/utils/string.py had the descriptions for preserve_order=True and preserve_order=False swapped.

Current (incorrect) docstring:

  • preserve_order=True → "ordering is dictated by the order of the target strings"
  • preserve_order=False → "ordering is the same as the order of the provided list of query regular expressions"

Actual code behavior (and examples):

  • preserve_order=False → target list order (default, no reordering)
  • preserve_order=True → query keys order (reordering occurs inside if preserve_order:)

The fix swaps the prose descriptions to match the actual code behavior and the provided examples.

Type of change

  • Documentation fix (non-breaking change which fixes a docstring)

Checklist

  • I have checked that there is no similar PR
  • The code examples in the docstrings are correct and unchanged

…es docstrings

The docstrings for both resolve_matching_names and resolve_matching_names_values
had the descriptions for preserve_order=True and preserve_order=False swapped.
The actual code behavior and examples were correct, but the prose descriptions
were inverted.

Fixes isaac-sim#5146
Copilot AI review requested due to automatic review settings May 8, 2026 15:37
@github-actions github-actions Bot added bug Something isn't working isaac-lab Related to Isaac Lab team labels May 8, 2026
@greptile-apps

greptile-apps Bot commented May 8, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes an inverted docstring in source/isaaclab/isaaclab/utils/string.py where the preserve_order=True and preserve_order=False descriptions were swapped in both resolve_matching_names and resolve_matching_names_values. The corrected descriptions now match the actual code logic and the provided examples.

  • resolve_matching_names: Description for preserve_order=False (target-string order) and preserve_order=True (query-key order) are now correct.
  • resolve_matching_names_values: Same swap applied — both functions now have accurate, consistent documentation.

Confidence Score: 5/5

Safe to merge — only docstring text is changed; no logic, behaviour, or interface is modified.

The change corrects two mirrored documentation errors. The actual implementation and all examples in the docstrings were already correct; only the prose descriptions for preserve_order=True and preserve_order=False were swapped. Reading the code confirms the fix is accurate for both functions.

No files require special attention.

Important Files Changed

Filename Overview
source/isaaclab/isaaclab/utils/string.py Swaps the swapped preserve_order=True/False descriptions in docstrings for resolve_matching_names and resolve_matching_names_values to match actual code behavior.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[resolve_matching_names / resolve_matching_names_values called] --> B{preserve_order?}
    B -- False default --> C[Return matches in target-string list order]
    B -- True --> D[Reorder results to follow query-key order]
Loading

Reviews (1): Last reviewed commit: "docs: fix swapped preserve_order descrip..." | Re-trigger Greptile

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes incorrect docstring descriptions for the preserve_order parameter in resolve_matching_names and resolve_matching_names_values so the prose matches the functions’ actual ordering behavior.

Changes:

  • Swapped the preserve_order=True vs preserve_order=False descriptions in resolve_matching_names docstring.
  • Swapped the preserve_order=True vs preserve_order=False descriptions in resolve_matching_names_values docstring.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


If the :attr:`preserve_order` is False, the ordering of the matched indices and names is the same as the order
If the :attr:`preserve_order` is True, the ordering of the matched indices and names is the same as the order
of the provided list of query regular expressions.
@dashitongzhi

Copy link
Copy Markdown
Contributor Author

Friendly ping for review 🙏 This is a small, focused fix. CI is passing. Thank you!

@dashitongzhi

Copy link
Copy Markdown
Contributor Author

Hi! 👋 This PR has passed all CI checks and looks ready for review. Could a maintainer please take a look when they have a chance? Thank you!

@kellyguo11
kellyguo11 merged commit 3cf5406 into isaac-sim:main May 28, 2026
13 of 17 checks passed
kellyguo11 added a commit that referenced this pull request May 28, 2026
# Description

Merge changes from main branch:

- #4875 - Adds Isaac-Stack-Cube-Franka-IK-Rel-v0 task variants
- #4909 - Updates minor RSL-RL configclass docstring
- #4934 - Updates Newton docs on main for 3.0 beta changes
- #5182 - Fix flatdict version pin to allow 4.1.0+
- #5195 - Add NCCL troubleshooting notes
- #5406 - Updates doc building job on main to match develop
- #5311 - Update skrl integration for version 2.0.0
- #5482 - Adds nightly-changelog.yml on main
- #5527 - Use isaaclab-bot GitHub App token for nightly changelog push
- #5537 - Address deprecation warnings in nightly changelog workflow
- #5746 - Fix .dockerignore for _isaac_sim symlink
- #5745 - Parameterize nightly compile over configurable branches
- #5546 - Fix swapped preserve_order docstrings
- #5817 - Update skrl agent configurations in the Isaac Lab template
kellyguo11 added a commit to kellyguo11/IsaacLab-public that referenced this pull request May 28, 2026
# Description

Merge changes from main branch:

- isaac-sim#4875 - Adds Isaac-Stack-Cube-Franka-IK-Rel-v0 task variants
- isaac-sim#4909 - Updates minor RSL-RL configclass docstring
- isaac-sim#4934 - Updates Newton docs on main for 3.0 beta changes
- isaac-sim#5182 - Fix flatdict version pin to allow 4.1.0+
- isaac-sim#5195 - Add NCCL troubleshooting notes
- isaac-sim#5406 - Updates doc building job on main to match develop
- isaac-sim#5311 - Update skrl integration for version 2.0.0
- isaac-sim#5482 - Adds nightly-changelog.yml on main
- isaac-sim#5527 - Use isaaclab-bot GitHub App token for nightly changelog push
- isaac-sim#5537 - Address deprecation warnings in nightly changelog workflow
- isaac-sim#5746 - Fix .dockerignore for _isaac_sim symlink
- isaac-sim#5745 - Parameterize nightly compile over configurable branches
- isaac-sim#5546 - Fix swapped preserve_order docstrings
- isaac-sim#5817 - Update skrl agent configurations in the Isaac Lab template
Du-322 pushed a commit to StanleyChueh/IsaacLab that referenced this pull request Aug 11, 2026
…es docstrings (isaac-sim#5546)

## Description

Fixes isaac-sim#5146

The docstrings for both `resolve_matching_names` and
`resolve_matching_names_values` in
`source/isaaclab/isaaclab/utils/string.py` had the descriptions for
`preserve_order=True` and `preserve_order=False` swapped.

**Current (incorrect) docstring:**
- `preserve_order=True` → "ordering is dictated by the order of the
target strings"
- `preserve_order=False` → "ordering is the same as the order of the
provided list of query regular expressions"

**Actual code behavior (and examples):**
- `preserve_order=False` → target list order (default, no reordering)
- `preserve_order=True` → query keys order (reordering occurs inside `if
preserve_order:`)

The fix swaps the prose descriptions to match the actual code behavior
and the provided examples.

## Type of change

- [x] Documentation fix (non-breaking change which fixes a docstring)

## Checklist

- [x] I have checked that there is no similar PR
- [x] The code examples in the docstrings are correct and unchanged

Co-authored-by: Cao Hanzhe <dashitongzhi@users.noreply.github.com>
StafaH added a commit that referenced this pull request Sep 20, 2026
## Description

Clarify the established binary-action convention without changing
behavior:

- `True` and non-negative floating-point actions select the configured
open command.
- `False` and negative floating-point actions select the configured
close command.
- Rename the internal selection mask to `close_mask` so its meaning
cannot be confused with the input action.
- Apply the same clarification to both joint-based and surface-gripper
binary actions, which share this contract.
- Correct the documented zero boundary: zero opens because the close
condition is strictly `< 0`.

The runtime convention is intentionally preserved. Reversing the boolean
mapping would break existing policies and downstream integrations that
follow the documented `True`/positive = open contract.

The earlier `resolve_matching_names` change is no longer part of this
PR. Both affected string helpers were fixed comprehensively by #5546.

Fixes #4670

## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)
- [x] Documentation update

## Release backport

- [x] <!-- backport-active-release --> Backport this pull request to the
active `release/3.0.0` branch after it merges into `develop`

This clarification applies to the same implementation on
`release/3.0.0`; please backport it so the supported 3.0 documentation
and source comments do not retain the ambiguous convention or incorrect
zero boundary.

## Validation

- Exercised both action terms with boolean and floating-point inputs,
including `True`, `False`, positive, zero, and negative values.
- `uv run isaaclab -f`
- `uv run python tools/changelog/cli.py check develop`
- `uv run --isolated --extra dev -- make -C docs current-docs`

## Checklist

- [x] I have read and understood the contribution guidelines.
- [x] I have run the pre-commit checks.
- [x] I have made corresponding changes to the documentation.
- [x] My changes generate no new warnings.
- [x] I have added a changelog fragment under
`source/isaaclab/changelog.d/`.
- [x] The contributor is listed in `CONTRIBUTORS.md`.

---------

Signed-off-by: alltheseas <alltheseas@users.noreply.github.com>
Co-authored-by: alltheseas <alltheseas@users.noreply.github.com>
Co-authored-by: nv-caelan <cgarrett@nvidia.com>
Co-authored-by: Clemens Schwarke <96480707+ClemensSchwarke@users.noreply.github.com>
Co-authored-by: Kelly Guo <kellyg@nvidia.com>
Co-authored-by: ooctipus <zhengyuz@nvidia.com>
Co-authored-by: Mustafa Haiderbhai <mhaiderbhai@nvidia.com>
isaaclab-bot Bot pushed a commit that referenced this pull request Sep 20, 2026
## Description

Clarify the established binary-action convention without changing
behavior:

- `True` and non-negative floating-point actions select the configured
open command.
- `False` and negative floating-point actions select the configured
close command.
- Rename the internal selection mask to `close_mask` so its meaning
cannot be confused with the input action.
- Apply the same clarification to both joint-based and surface-gripper
binary actions, which share this contract.
- Correct the documented zero boundary: zero opens because the close
condition is strictly `< 0`.

The runtime convention is intentionally preserved. Reversing the boolean
mapping would break existing policies and downstream integrations that
follow the documented `True`/positive = open contract.

The earlier `resolve_matching_names` change is no longer part of this
PR. Both affected string helpers were fixed comprehensively by #5546.

Fixes #4670

## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)
- [x] Documentation update

## Release backport

- [x] <!-- backport-active-release --> Backport this pull request to the
active `release/3.0.0` branch after it merges into `develop`

This clarification applies to the same implementation on
`release/3.0.0`; please backport it so the supported 3.0 documentation
and source comments do not retain the ambiguous convention or incorrect
zero boundary.

## Validation

- Exercised both action terms with boolean and floating-point inputs,
including `True`, `False`, positive, zero, and negative values.
- `uv run isaaclab -f`
- `uv run python tools/changelog/cli.py check develop`
- `uv run --isolated --extra dev -- make -C docs current-docs`

## Checklist

- [x] I have read and understood the contribution guidelines.
- [x] I have run the pre-commit checks.
- [x] I have made corresponding changes to the documentation.
- [x] My changes generate no new warnings.
- [x] I have added a changelog fragment under
`source/isaaclab/changelog.d/`.
- [x] The contributor is listed in `CONTRIBUTORS.md`.

---------

Signed-off-by: alltheseas <alltheseas@users.noreply.github.com>
Co-authored-by: alltheseas <alltheseas@users.noreply.github.com>
Co-authored-by: nv-caelan <cgarrett@nvidia.com>
Co-authored-by: Clemens Schwarke <96480707+ClemensSchwarke@users.noreply.github.com>
Co-authored-by: Kelly Guo <kellyg@nvidia.com>
Co-authored-by: ooctipus <zhengyuz@nvidia.com>
Co-authored-by: Mustafa Haiderbhai <mhaiderbhai@nvidia.com>

(cherry picked from commit 1fb0997)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug Report] resolve_matching_names (and resolve_matching_names_values) docstring has preserve_order=True/False descriptions swapped

3 participants