Repository navigation
Modifies update_class_from_dict() to wholesale replace flat Iterables - #2511
Conversation
|
Agreed. Faced a similar issue. Can you also add a unit test for this change to make sure we maintain the desired behavior? Also wondering: |
I have added the unit test case (i.e.,
Do you mean we should replace the Iterable elements wholesale, wherever they are flat Iterable or not? This creates an issue when the list has a subdictionary (e.g., Let me know if you meant something else or you have other feedback. |
|
Hi @Mayankm96, just a gentle ping on this PR whenever you have a moment, thanks! |
Signed-off-by: Kelly Guo <[email protected]>
Signed-off-by: Kelly Guo <[email protected]>
Signed-off-by: Kelly Guo <[email protected]>
…es (isaac-sim#2511) # Description Currently, `update_class_from_dict()` does not allow updating the configclass Iterable elements with Hydra, when the provided Iterable length differs from the default value. Such a feature is nevertheless needed when changing the network layer depth on the go, e.g., while using learning libraries that utilize configclass (see isaac-sim#2456 for details). This PR modifies `update_class_from_dict()` such that if an element is a flat Iterable (e.g., flat list), it is replaced wholesale, without checking the lengths. Moreover, the PR modifies the robustness of the function against a few edge cases that might break the execution, and adds comments to make it easier to follow the logic flow. Note: I left the changelog entry as `[Unreleased]` until a green light is given. Fixes isaac-sim#2456. ## Type of change - Bug fix (non-breaking change which fixes an issue) ## Checklist - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./isaaclab.sh --format` - [ ] I have made corresponding changes to the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [x] 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: Kelly Guo <[email protected]> Signed-off-by: Kelly Guo <[email protected]> Co-authored-by: Kelly Guo <[email protected]> Co-authored-by: Kelly Guo <[email protected]>
…es (isaac-sim#2511) # Description Currently, `update_class_from_dict()` does not allow updating the configclass Iterable elements with Hydra, when the provided Iterable length differs from the default value. Such a feature is nevertheless needed when changing the network layer depth on the go, e.g., while using learning libraries that utilize configclass (see isaac-sim#2456 for details). This PR modifies `update_class_from_dict()` such that if an element is a flat Iterable (e.g., flat list), it is replaced wholesale, without checking the lengths. Moreover, the PR modifies the robustness of the function against a few edge cases that might break the execution, and adds comments to make it easier to follow the logic flow. Note: I left the changelog entry as `[Unreleased]` until a green light is given. Fixes isaac-sim#2456. ## Type of change - Bug fix (non-breaking change which fixes an issue) ## Checklist - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./isaaclab.sh --format` - [ ] I have made corresponding changes to the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [x] 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: Kelly Guo <[email protected]> Signed-off-by: Kelly Guo <[email protected]> Co-authored-by: Kelly Guo <[email protected]> Co-authored-by: Kelly Guo <[email protected]>
…es (isaac-sim#2511) # Description Currently, `update_class_from_dict()` does not allow updating the configclass Iterable elements with Hydra, when the provided Iterable length differs from the default value. Such a feature is nevertheless needed when changing the network layer depth on the go, e.g., while using learning libraries that utilize configclass (see isaac-sim#2456 for details). This PR modifies `update_class_from_dict()` such that if an element is a flat Iterable (e.g., flat list), it is replaced wholesale, without checking the lengths. Moreover, the PR modifies the robustness of the function against a few edge cases that might break the execution, and adds comments to make it easier to follow the logic flow. Note: I left the changelog entry as `[Unreleased]` until a green light is given. Fixes isaac-sim#2456. ## Type of change - Bug fix (non-breaking change which fixes an issue) ## Checklist - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./isaaclab.sh --format` - [ ] I have made corresponding changes to the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [x] 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: Kelly Guo <[email protected]> Signed-off-by: Kelly Guo <[email protected]> Co-authored-by: Kelly Guo <[email protected]> Co-authored-by: Kelly Guo <[email protected]>
Description
Currently,
update_class_from_dict()does not allow updating the configclass Iterable elements with Hydra, when the provided Iterable length differs from the default value. Such a feature is nevertheless needed when changing the network layer depth on the go, e.g., while using learning libraries that utilize configclass (see #2456 for details).This PR modifies
update_class_from_dict()such that if an element is a flat Iterable (e.g., flat list), it is replaced wholesale, without checking the lengths. Moreover, the PR modifies the robustness of the function against a few edge cases that might break the execution, and adds comments to make it easier to follow the logic flow.Note: I left the changelog entry as
[Unreleased]until a green light is given.Fixes #2456.
Type of change
Checklist
pre-commitchecks with./isaaclab.sh --formatconfig/extension.tomlfileCONTRIBUTORS.mdor my name already exists there