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

Inserting interior subgraphs fails #180

Open
jl-wynen opened this issue Sep 10, 2024 · 3 comments · May be fixed by scipp/cyclebane#14
Open

Inserting interior subgraphs fails #180

jl-wynen opened this issue Sep 10, 2024 · 3 comments · May be fixed by scipp/cyclebane#14
Assignees

Comments

@jl-wynen
Copy link
Member

Given a base graph with a hole, I would like to insert a component subgraph to fill that hole. Eor example, below, component fits into the hole between B and N in the base graph.

flowchart LR
    subgraph component
        direction LR
        nB[B] -->|fn| nN[N]
    end
    subgraph base
        direction LR
        A -->|f1| B
        B ~~~ N
        N -->|f2| C
    end
Loading

I would like to use base[N] = component to construct a complete graph. But Sciline complains with

ValueError: Node inputs differ for node '__main__.B':
  {__main__.A: {'key': __main__.A}}
  {}

The reason is that in base, there is a dependency of B on A. But in component, B does not have a dependency.

Is it possible to support this use case? Here, this should be fine because component does not have a way to provide B, i.e., B is missing. So basically, can we allow merging nodes where in one graph, the node is missing?

For more context: I encountered this in the monitor normalisation in ESSdiffraction where I want to insert either one of the monitor normalisation providers or the proton charge normalisation provider. I can implement this particular case by inserting a provider into base instead of a subgraph. But in general, it would be useful to insert subgraphs when a single provider is not enough.

@SimonHeybrock
Copy link
Member

Are you saying that B has neither a value nor a provider? I think this may indeed be a special "unintialized" case that should be accepted by Cyclebane?

@jl-wynen
Copy link
Member Author

Are you saying that B has neither a value nor a provider?

Yes. component only contains fn.

@SimonHeybrock
Copy link
Member

I think the key question to figure out is how to distinguish this from true graph-structure mismatches. See https://github.com/scipp/cyclebane/blob/ee09d242d4bfd14471cfffa067d0101e620de00d/tests/graph_test.py#L605-L616.

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

Successfully merging a pull request may close this issue.

2 participants