632
632
633
633
function ls (dfg:: G , :: Type{T} ) where {G <: AbstractDFG , T <: FunctorInferenceType }
634
634
xx = getFactors (dfg)
635
- names = getfield .( typeof .(getFactorType .(xx)), :name ) .| > Symbol
635
+ names = typeof .(getFactorType .(xx)) .| > nameof
636
636
vxx = view (xx, names .== Symbol (T))
637
637
map (x-> x. label, vxx)
638
638
end
@@ -694,7 +694,7 @@ function lsWho(dfg::AbstractDFG, type::Symbol)
694
694
vars = getVariables (dfg)
695
695
labels = Symbol[]
696
696
for v in vars
697
- varType = typeof (getVariableType (v)). name |> Symbol
697
+ varType = typeof (getVariableType (v)) |> nameof
698
698
varType == type && push! (labels, v. label)
699
699
end
700
700
return labels
@@ -721,7 +721,7 @@ function lsfWho(dfg::AbstractDFG, type::Symbol)
721
721
facs = getFactors (dfg)
722
722
labels = Symbol[]
723
723
for f in facs
724
- facType = typeof (getFactorType (f)). name |> Symbol
724
+ facType = typeof (getFactorType (f)) |> nameof
725
725
facType == type && push! (labels, f. label)
726
726
end
727
727
return labels
@@ -740,7 +740,7 @@ function lsTypes(dfg::AbstractDFG)
740
740
vars = getVariables (dfg)
741
741
alltypes = Set {Symbol} ()
742
742
for v in vars
743
- varType = typeof (getVariableType (v)). name |> Symbol
743
+ varType = typeof (getVariableType (v)) |> nameof
744
744
push! (alltypes, varType)
745
745
end
746
746
return collect (alltypes)
@@ -756,7 +756,7 @@ function lsTypesDict(dfg::AbstractDFG)
756
756
vars = getVariables (dfg)
757
757
alltypes = Dict {Symbol,Vector{Symbol}} ()
758
758
for v in vars
759
- varType = typeof (getVariableType (v)). name |> Symbol
759
+ varType = typeof (getVariableType (v)) |> nameof
760
760
d = get! (alltypes, varType, Symbol[])
761
761
push! (d, v. label)
762
762
end
@@ -772,7 +772,7 @@ function lsfTypes(dfg::AbstractDFG)
772
772
facs = getFactors (dfg)
773
773
alltypes = Set {Symbol} ()
774
774
for f in facs
775
- facType = typeof (getFactorType (f)). name |> Symbol
775
+ facType = typeof (getFactorType (f)) |> nameof
776
776
push! (alltypes, facType)
777
777
end
778
778
return collect (alltypes)
@@ -787,7 +787,7 @@ function lsfTypesDict(dfg::AbstractDFG)
787
787
facs = getFactors (dfg)
788
788
alltypes = Dict {Symbol,Vector{Symbol}} ()
789
789
for f in facs
790
- facType = typeof (getFactorType (f)). name |> Symbol
790
+ facType = typeof (getFactorType (f)) |> nameof
791
791
d = get! (alltypes, facType, Symbol[])
792
792
push! (d, f. label)
793
793
end
@@ -1099,7 +1099,7 @@ Related
1099
1099
function isPathFactorsHomogeneous (dfg:: AbstractDFG , from:: Symbol , to:: Symbol )
1100
1100
# FIXME , must consider all paths, not just shortest...
1101
1101
pth = intersect (findShortestPathDijkstra (dfg, from, to), lsf (dfg))
1102
- types = getFactorType .(dfg, pth) .| > typeof .| > x -> (x) . name
1102
+ types = getFactorType .(dfg, pth) .| > typeof .| > nameof
1103
1103
utyp = unique (types)
1104
1104
(length (utyp) == 1 ), utyp
1105
1105
end
0 commit comments