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

pos in combination with as_graph leads to unexpected ids #718

Open
sebffischer opened this issue Apr 20, 2023 · 1 comment
Open

pos in combination with as_graph leads to unexpected ids #718

sebffischer opened this issue Apr 20, 2023 · 1 comment

Comments

@sebffischer
Copy link
Sponsor Member

library(mlr3pipelines)
as_graph(pos(c("pca", "ica")))
#> Graph with 2 PipeOps:
#>       ID         State sccssors prdcssors
#>  pca.pca <<UNTRAINED>>                   
#>  ica.ica <<UNTRAINED>>

Created on 2023-04-20 with reprex v2.0.2

@mb706
Copy link
Collaborator

mb706 commented May 22, 2023

I think as_graph does the sensible thing here: if a named list is given, it uses the names as prefix. This makes it possible to do things like

as_graph(list(a = po("nop"), b = po("nop")))
#> Graph with 2 PipeOps:
#>     ID         State sccssors prdcssors
#>  a.nop <<UNTRAINED>>                   
#>  b.nop <<UNTRAINED>>    

without ID collisions.

We could argue that pos() should not use the IDs as names for the generated list. Why are we doing that again?

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

No branches or pull requests

2 participants