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

Replace Sugraph #538

Open
mb706 opened this issue Nov 5, 2020 · 6 comments · May be fixed by #560
Open

Replace Sugraph #538

mb706 opened this issue Nov 5, 2020 · 6 comments · May be fixed by #560
Assignees
Labels
Status: Needs Design Needs some thought and design decisions.

Comments

@mb706
Copy link
Collaborator

mb706 commented Nov 5, 2020

A potentially useful operation on a Graph would be to replace a PipeOp, or an entire subgraph, with a different Graph. With this, one could "edit" the result of a ppl() call, for example, if the pipeline happens to have a single / very few pipeops that are different than what would be desired. Currenlty the user would have to edit the connection table to do this, which may be a bit tedious.

Suggested UI for this would be Graph$replace_subgraph(ids, substitute), substitute being something that can be turned into a graph using as_graph. The operation would remove ids from the graph, and do the equivalent of <channels into ids> %>>% substitute %>>% <channels out of ids> inside the graph (This would entail automatic one-to-many and vararg channel handling, as well as type checking).

@sumny sumny self-assigned this Nov 6, 2020
@mb706
Copy link
Collaborator Author

mb706 commented Dec 4, 2020

Which (newly free) output channels to connect to new graph, and in what order?

  • take original graph, remember output_orig as the entire graph's output channels (graph$output)
  • delete IDs of pipeops that are being cut out, and remove their edges (obvsly)
  • look what new graph$output channels there are. Set-subtract output_orig from these
  • use these output channels & this order to connect to new graph
  • should be in-place

@mb706
Copy link
Collaborator Author

mb706 commented Dec 4, 2020

we want a complementary function that gives us the IDs of all pipeops that are "between" two (or more) pipeops.

@mb706
Copy link
Collaborator Author

mb706 commented Dec 4, 2020

edge cases to watch out for: entire graph, beginning of graph, end of graph

@mb706
Copy link
Collaborator Author

mb706 commented Dec 4, 2020

vararg will be difficult...

@mb706
Copy link
Collaborator Author

mb706 commented Dec 4, 2020

should work the same as %>>% I would say

@mb706
Copy link
Collaborator Author

mb706 commented Dec 4, 2020

Also $remove_pipeop() which removes edges and updates param_set

@sumny sumny linked a pull request Jan 31, 2021 that will close this issue
4 tasks
@mb706 mb706 added the Status: Needs Design Needs some thought and design decisions. label Sep 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Design Needs some thought and design decisions.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants