isaac-sim / IsaacLab

Unified framework for robot learning built on NVIDIA Isaac Sim
https://isaac-sim.github.io/IsaacLab
Other
2.29k stars 935 forks source link

[Proposal] don't repeat `cfg` #306

Open VladimirFokow opened 8 months ago

VladimirFokow commented 8 months ago

Proposal

https://github.com/NVIDIA-Omniverse/orbit/blob/83d62e212dde22ebc80f140388417fbca12229ed/docs/source/tutorials/00_sim/spawn_prims.rst?plain=1#L67-L68

Repeating the cfg inside of the brackets goes against the DRY principle

cfg is already the object that's calling func -> so func can automatically know about it - no need to make the user repeat it.

(If there's no better way, e.g. larger code redesign), it can be done if func is not an attribute but a method - using self.


Motivation

Better API design.

Checklist

Acceptance Criteria

Either:

VladimirFokow commented 8 months ago

plus, the func isn't really a descriptive method name. Maybe spawn would be better?

Maybe, spawn method can be defined with this new interface, while func is marked deprecated (to maintain backwards compatibility for some time).

Dhoeller19 commented 1 month ago

@VladimirFokow thanks for the suggestion, we are working on it.