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

Exclude build dependencies when counting inputs to new nested node #1946

Merged
merged 3 commits into from
Aug 7, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions Bonsai.Editor/GraphModel/WorkflowEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1114,9 +1114,10 @@ void ConfigureWorkflowBuilder(
CreateGraphNodeType nodeType)
{
// Estimate number of inputs to the nested node
var inputCount = workflowBuilder.ArgumentRange.LowerBound;
if (nodeType == CreateGraphNodeType.Successor) inputCount = Math.Max(inputCount, selectedNodes.Count());
else inputCount = Math.Max(inputCount, selectedNodes.Sum(node => workflow.PredecessorEdges(node).Count()));
var inputCount = nodeType == CreateGraphNodeType.Successor
? selectedNodes.Count(node => !node.Value.IsBuildDependency())
: selectedNodes.Sum(node => workflow.PredecessorEdges(node).Count(edge => !edge.Item1.Value.IsBuildDependency()));
glopesdev marked this conversation as resolved.
Show resolved Hide resolved
inputCount = Math.Max(workflowBuilder.ArgumentRange.LowerBound, inputCount);

// Limit number of inputs depending on nested operator argument range
if (!(workflowBuilder is GroupWorkflowBuilder || workflowBuilder.GetType() == typeof(Defer)))
Expand Down