Skip to content

Commit 4959b83

Browse files
committed
solved or count if no statelabel
1 parent 83e63e7 commit 4959b83

2 files changed

Lines changed: 13 additions & 4 deletions

File tree

src/entities/HomotopyDensity.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,9 @@ abstract type AbstractPartialTrait end
3737
topologykind::HT
3838
formkind::RF
3939
statekind::T
40-
partial::PT = nothing & (ignore = true,) #TODO deprecated field, still needed for AMP.
41-
# partials field needed for AMP v0.15, will be JSON ignored in DFG v0.29, needs better solution by DFG v0.30
40+
# FIXME, rename to subbmersion or deprecate completely?
41+
""" partials field needed for AMP v0.15, will be JSON ignored in DFG v0.29, needs better solution by DFG v0.30 """
42+
partial::PT = nothing & (ignore = true,)
4243
end
4344

4445
StructUtils.structlike(::StructUtils.StructStyle, ::Type{<:HomotopyReprDFG}) = true

src/services/variable_ops.jl

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,11 @@ isSolved, setSolvedCount!
211211
"""
212212
getSolvedCount(v::State) = v.solves
213213
function getSolvedCount(v::VariableDFG, solveKey::Symbol = :default)
214-
return getState(v, solveKey) |> getSolvedCount
214+
if hasState(v, solveKey)
215+
return getState(v, solveKey) |> getSolvedCount
216+
else
217+
return 0
218+
end
215219
end
216220
function getSolvedCount(dfg::AbstractDFG, sym::Symbol, solveKey::Symbol = :default)
217221
return getSolvedCount(getVariable(dfg, sym), solveKey)
@@ -250,7 +254,11 @@ getSolved, setSolved!
250254
"""
251255
isSolved(v::State) = 0 < v.solves
252256
function isSolved(v::VariableDFG, solveKey::Symbol = :default)
253-
return getState(v, solveKey) |> isSolved
257+
if hasState(v, solveKey)
258+
return getState(v, solveKey) |> isSolved
259+
else
260+
return false
261+
end
254262
end
255263
function isSolved(dfg::AbstractDFG, sym::Symbol, solveKey::Symbol = :default)
256264
return isSolved(getVariable(dfg, sym), solveKey)

0 commit comments

Comments
 (0)