Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions src/entities/Factor.jl
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,26 @@ function FactorDFG(
timestamp = TimeDateZone(timestamp.utc_datetime)
end

#TODO move to core constructor
if !isempty(multihypo) && length(multihypo) != length(variableorder)
throw(
ArgumentError(
"multihypo length ($(length(multihypo))) must match the number of variables ($(length(variableorder))). " *
"See fractional data-association uncertainty docs.",
),
)
end
if length(variableorder) == 1 && observation isa AbstractRelativeObservation
throw(
ArgumentError(
"Relative observation $(typeof(observation)) requires at least two variables, but only one was provided: $variableorder. Use a subtype of AbstractPriorObservation for single-variable factors.",
),
)
end
allunique(variableorder) || throw(
ArgumentError("Variable order must be unique, got duplicates in $variableorder"),
)

# create factor data
hyper = Recipehyper(; multihypo, nullhypo, inflation)
state = Recipestate()
Expand Down
1 change: 1 addition & 0 deletions src/entities/Variable.jl
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ function VariableDFG(
if solvable isa Int
solvable = Ref(solvable)
end
tags = tags isa Set ? tags : Set{Symbol}(tags)
union!(tags, [:VARIABLE])

P = getPointType(T)
Expand Down
6 changes: 5 additions & 1 deletion src/services/compare.jl
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,11 @@ function compareVariable(
union!(skiplist, skip)
# TP = TP && compareAll(A.states, B.states; skip = skiplist, show = show)

Ad = getState(A, :default) #FIXME why onlly comparing default?
#FIXME why only comparing hardcoded default?
if !hasState(A, :default) && !hasState(B, :default)
return false
end
Ad = getState(A, :default)
Bd = getState(B, :default)

# TP = TP && compareAll(A.attributes, B.attributes, skip=[:variableType;], show=show)
Expand Down
Loading