@@ -1518,47 +1518,47 @@ function BuildingSubgraphs(testDFGAPI; VARTYPE = VariableDFG, FACTYPE = FactorDF
15181518 # "Getting Subgraphs"
15191519 dfg, verts, facs = connectivityTestGraph (testDFGAPI, VARTYPE, FACTYPE)
15201520 # Subgraphs
1521- dfgSubgraph = buildSubgraph (testDFGAPI, dfg, [verts[1 ]. label], 2 )
1521+ dfgSubgraph = getSubgraph (testDFGAPI, dfg, [verts[1 ]. label], 2 )
15221522 # Only returns x1 and x2
15231523 @test issetequal ([:x1 , :x1x2f1 , :x2 ], [ls (dfgSubgraph)... , lsf (dfgSubgraph)... ])
15241524 #
1525- dfgSubgraph = buildSubgraph (testDFGAPI, dfg, [:x1 , :x2 , :x1x2f1 ])
1525+ dfgSubgraph = getSubgraph (testDFGAPI, dfg, [:x1 , :x2 , :x1x2f1 ])
15261526 # Only returns x1 and x2
15271527 @test issetequal ([:x1 , :x1x2f1 , :x2 ], [ls (dfgSubgraph)... , lsf (dfgSubgraph)... ])
15281528
1529- dfgSubgraph = buildSubgraph (testDFGAPI, dfg, [:x1x2f1 ], 1 )
1529+ dfgSubgraph = getSubgraph (testDFGAPI, dfg, [:x1x2f1 ], 1 )
15301530 # Only returns x1 and x2
15311531 @test issetequal ([:x1 , :x1x2f1 , :x2 ], [ls (dfgSubgraph)... , lsf (dfgSubgraph)... ])
15321532
15331533 # TODO if not a GraphsDFG with and summary or skeleton
15341534 if VARTYPE == VariableDFG
1535- dfgSubgraph = buildSubgraph (testDFGAPI, dfg, [:x8 ], 2 ; solvableFilter = >= (1 ))
1535+ dfgSubgraph = getSubgraph (testDFGAPI, dfg, [:x8 ], 2 ; solvableFilter = >= (1 ))
15361536 @test issetequal ([:x7 ], [ls (dfgSubgraph)... , lsf (dfgSubgraph)... ])
15371537 # end if not a GraphsDFG with and summary or skeleton
15381538 end
15391539 # DFG issue #95 - confirming that getSubgraphAroundNode retains order
15401540 # REF: https://github.com/JuliaRobotics/DistributedFactorGraphs.jl/issues/95
15411541 for fId in listVariables (dfg)
15421542 # Get a subgraph of this and it's related factors+variables
1543- dfgSubgraph = buildSubgraph (testDFGAPI, dfg, [fId], 2 )
1543+ dfgSubgraph = getSubgraph (testDFGAPI, dfg, [fId], 2 )
15441544 # For each factor check that the order the copied graph == original
15451545 for fact in getFactors (dfgSubgraph)
15461546 @test fact. variableorder == getFactor (dfg, fact. label). variableorder
15471547 end
15481548 end
15491549
1550- # TODO buildSubgraph default constructors for skeleton and summary
1550+ # TODO getSubgraph default constructors for skeleton and summary
15511551 if VARTYPE == VariableDFG
1552- dfgSubgraph = buildSubgraph (dfg, [:x1 , :x2 , :x1x2f1 ])
1552+ dfgSubgraph = getSubgraph (dfg, [:x1 , :x2 , :x1x2f1 ])
15531553 @test issetequal ([:x1 , :x1x2f1 , :x2 ], [ls (dfgSubgraph)... , lsf (dfgSubgraph)... ])
15541554
1555- dfgSubgraph = buildSubgraph (dfg, [:x2 , :x3 ], 2 )
1555+ dfgSubgraph = getSubgraph (dfg, [:x2 , :x3 ], 2 )
15561556 @test issetequal (
15571557 [:x2 , :x3 , :x1 , :x4 , :x3x4f1 , :x1x2f1 , :x2x3f1 ],
15581558 [ls (dfgSubgraph)... , lsf (dfgSubgraph)... ],
15591559 )
15601560
1561- dfgSubgraph = buildSubgraph (dfg, [:x1x2f1 ], 1 )
1561+ dfgSubgraph = getSubgraph (dfg, [:x1x2f1 ], 1 )
15621562 @test issetequal ([:x1 , :x1x2f1 , :x2 ], [ls (dfgSubgraph)... , lsf (dfgSubgraph)... ])
15631563 end
15641564end
@@ -1893,14 +1893,14 @@ function PathFindingTests(testDFGAPI)
18931893
18941894 # --- Restrict with factorLabels only (all variables kept) ---
18951895 # Only allow the first 4 factors, path x1→x5 should still work
1896- facs_first4 = listFactors (dfg; labelFilter = contains (r" x[1-4]" ))
1896+ facs_first4 = listFactors (dfg; labelFilter = contains (r" x[1-4](?! \d ) " ))
18971897 result_fac = getPath (dfg, :x1 , :x5 ; factorLabels = facs_first4)
18981898 @test first (result_fac. path) == :x1
18991899 @test last (result_fac. path) == :x5
19001900
19011901 # --- Restrict with both variableLabels and factorLabels ---
19021902 vars_1to5 = listVariables (dfg; typeFilter = == (TestVariableType1 ()))
1903- facs_1to4 = listFactors (dfg; labelFilter = contains (r" x[1-4]" ))
1903+ facs_1to4 = listFactors (dfg; labelFilter = contains (r" x[1-4](?! \d ) " ))
19041904 result_both =
19051905 getPath (dfg, :x1 , :x5 ; variableLabels = vars_1to5, factorLabels = facs_1to4)
19061906 @test first (result_both. path) == :x1
0 commit comments