isaac-sim / IsaacLab

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

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

Open VladimirFokow opened 5 months ago

VladimirFokow commented 5 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 5 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).