Skip to content

Feat: Build a new Graph as a combination of Graphs #526

Open
@jbdebard

Description

@jbdebard

Is your feature request related to a problem? Please describe.
I am creating specific Graphs at runtime as the combination of several Graphs depending on a configuration.

Describe the solution you'd like
I would need to define a Graph as a merge of 2 or more Graphs with additional transitions, or to be able to get both actions and transitions in the Graph API so that I can extract them from my "sub" graphs and can re-combine them while building a new Graph.

graph_1 = (
    GraphBuilder()
    .with_actions(**actions_1)
    .with_transitions(*transitions_1)
    .build()
)

graph_2 = (
    GraphBuilder()
    .with_actions(**actions_2)
    .with_transitions(*transitions_2)
    .build()
)

final_graph = (
    GraphBuilder()
    .with_graphs(graph_1, graph_2)
    .with_transitions(*additional_transitions)
    .build()

Describe alternatives you've considered
I could consider passing my 'sub' graphs as a set of actions and transitions instead of Graph, but I find this solution not very elegant and will add complexity to my code as I also might need to use the 'sub' graphs in standalone burr Applications.

Thanks for your feedback,
KR
jbd

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions