IsaacLab icon indicating copy to clipboard operation
IsaacLab copied to clipboard

[Proposal] don't repeat `cfg`

Open VladimirFokow opened this issue 1 year ago • 2 comments

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

  • [x] I have checked that there is no similar issue in the repo (required)

Acceptance Criteria

Either:

  • [ ] fixed
  • [ ] argumented why it should remain this way in the docs

VladimirFokow avatar Mar 21 '24 19:03 VladimirFokow

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).

VladimirFokow avatar Mar 21 '24 19:03 VladimirFokow

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

Dhoeller19 avatar Oct 04 '24 15:10 Dhoeller19