Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: Dictionary$help() function #72

Open
mb706 opened this issue Jul 7, 2022 · 3 comments
Open

Suggestion: Dictionary$help() function #72

mb706 opened this issue Jul 7, 2022 · 3 comments

Comments

@mb706
Copy link
Contributor

mb706 commented Jul 7, 2022

For many objects there is lrn("xxx")$help(), but the dictionary can also contain entries that do not map 1-to-1 with R6-classes, such as ppl(), which constructs different Graphs. However, we have the nomenclature of <dictname>_<key> for help files. I therefore suggest that Dictionary$help(<key>) tries to show help for the <dictname>_<key> help entry (and, failing that, tries to construct <key> and call its help() function.

@mb706
Copy link
Contributor Author

mb706 commented Jul 7, 2022

Usage would then look like

ppl()$help("robustify")

(because ppl() with empty arguments returns the dictionary)

@mb706
Copy link
Contributor Author

mb706 commented Jul 7, 2022

For this, $add() would probably need a package argument that defaults to the name of the "topenv" of the calling frame or something like that.

@mb706
Copy link
Contributor Author

mb706 commented Jul 7, 2022

To construct a minimal object to call $help() on, some of the items need some extra construction item that is not otherwise supplied, e.g. PipeOpLearner$new() needs a Learner-like object. This would be the opportunity to also support that: add an auxiliary construction arguments option to Dictionary$add() (as I am doing here, see example usage here, note the alist!) and then use that to construct an object for $help() access (as here).

Maybe this line, without the $help(), could then also be a helper function, get_dummy(), that could then be used by as.data.table().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant