Skip to content

[Bug Report] Confusing or incorrect docstring for resolve_matching_names_values #3849

@rdeits-bd

Description

@rdeits-bd

Describe the bug

The documentation of resolve_matching_names_values says:

def resolve_matching_names_values(

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 strings. This means that the ordering is dictated by the order of the target strings and not the order of the query regular expressions.

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

but the example appears to show the exact opposite behavior:

For example, consider the dictionary is {"a|d|e": 1, "b|c": 2}, the list of strings is ['a', 'b', 'c', 'd', 'e']. If :attr:preserve_order is False, then the function will return the indices of the matched strings, the matched strings, and the values as: ([0, 1, 2, 3, 4], ['a', 'b', 'c', 'd', 'e'], [1, 2, 2, 1, 1]).

That example shows preserve_order=False, but the list of returned indices is clearly the same as the order of the list_of_strings, which is the opposite of what the previous part of the docstring says.

I think the docstring only makes sense if you interpret "provided list of strings" as "keys in the data dictionary", but that doesn't make sense given that there is a variable named list_of_strings.

System Info

Describe the characteristic of your environment:

Checklist

  • I have checked that there is no similar issue in the repo (required)
  • I have checked that the issue is not in running Isaac Sim itself and is related to the repo

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdocumentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions