diff --git a/src/entities/HomotopyDensity.jl b/src/entities/HomotopyDensity.jl index 7a4a217f..c241a16c 100644 --- a/src/entities/HomotopyDensity.jl +++ b/src/entities/HomotopyDensity.jl @@ -37,8 +37,9 @@ abstract type AbstractPartialTrait end topologykind::HT formkind::RF statekind::T - partial::PT = nothing & (ignore = true,) #TODO deprecated field, still needed for AMP. - # partials field needed for AMP v0.15, will be JSON ignored in DFG v0.29, needs better solution by DFG v0.30 + # FIXME, rename to subbmersion or deprecate completely? + """ partials field needed for AMP v0.15, will be JSON ignored in DFG v0.29, needs better solution by DFG v0.30 """ + partial::PT = nothing & (ignore = true,) end StructUtils.structlike(::StructUtils.StructStyle, ::Type{<:HomotopyReprDFG}) = true diff --git a/src/services/variable_ops.jl b/src/services/variable_ops.jl index 38880e41..6189d0b5 100644 --- a/src/services/variable_ops.jl +++ b/src/services/variable_ops.jl @@ -211,7 +211,11 @@ isSolved, setSolvedCount! """ getSolvedCount(v::State) = v.solves function getSolvedCount(v::VariableDFG, solveKey::Symbol = :default) - return getState(v, solveKey) |> getSolvedCount + if hasState(v, solveKey) + return getState(v, solveKey) |> getSolvedCount + else + return 0 + end end function getSolvedCount(dfg::AbstractDFG, sym::Symbol, solveKey::Symbol = :default) return getSolvedCount(getVariable(dfg, sym), solveKey) @@ -250,7 +254,11 @@ getSolved, setSolved! """ isSolved(v::State) = 0 < v.solves function isSolved(v::VariableDFG, solveKey::Symbol = :default) - return getState(v, solveKey) |> isSolved + if hasState(v, solveKey) + return getState(v, solveKey) |> isSolved + else + return false + end end function isSolved(dfg::AbstractDFG, sym::Symbol, solveKey::Symbol = :default) return isSolved(getVariable(dfg, sym), solveKey)