Skip to content

Commit a0be4be

Browse files
authored
Optional show progress on copyGraph! (#1059)
1 parent f2fd33e commit a0be4be

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/services/AbstractDFG.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,13 +1076,15 @@ function copyGraph!(
10761076
overwriteDest::Bool = false,
10771077
deepcopyNodes::Bool = false,
10781078
verbose::Bool = false,
1079+
showprogress::Bool = false,
10791080
)
10801081
# Split into variables and factors
10811082
sourceVariables = map(vId -> getVariable(sourceDFG, vId), variableLabels)
10821083
sourceFactors = map(fId -> getFactor(sourceDFG, fId), factorLabels)
10831084

10841085
# Now we have to add all variables first,
1085-
@showprogress "copy variables" for variable in sourceVariables
1086+
@showprogress desc = "copy variables" enabled = showprogress for variable in
1087+
sourceVariables
10861088
variableCopy = deepcopyNodes ? deepcopy(variable) : variable
10871089
if !exists(destDFG, variable)
10881090
addVariable!(destDFG, variableCopy)
@@ -1093,7 +1095,7 @@ function copyGraph!(
10931095
end
10941096
end
10951097
# And then all factors to the destDFG.
1096-
@showprogress "copy factors" for factor in sourceFactors
1098+
@showprogress desc = "copy factors" enabled = showprogress for factor in sourceFactors
10971099
# Get the original factor variables (we need them to create it)
10981100
sourceFactorVariableIds = collect(factor._variableOrderSymbols)
10991101
# Find the labels and associated variables in our new subgraph

0 commit comments

Comments
 (0)