Improve State.belief semantics and add explicit topology; mark getSolverParams as deprecated#1227
Improve State.belief semantics and add explicit topology; mark getSolverParams as deprecated#1227
Conversation
…Params as deprecated
There was a problem hiding this comment.
Pull request overview
This PR clarifies belief/state semantics by renaming the serialized belief container and introducing an explicit “topology” trait for homotopy beliefs, while also deprecating getSolverParams as part of the longer-term plan to remove SolverParams from the DFG object.
Changes:
- Rename
StoredBelief→StoredHomotopyBeliefand addAbstractHomotopyTopology(Roots/Leaves/Tree topologies + explicit parent arrays). - Rename/reshape belief fields (
covariances→shapes,bandwidth→bandwidths::Vector) and update serialization, printing, equality/compare, and tests accordingly. - Deprecate
getSolverParams(dfg)with a runtime depwarn; adjust a couple of module exports.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| test/testSerializingVariables.jl | Updates JSON round-trip tests to new belief type/topology and shapes field. |
| src/services/print.jl | Switches printed KDE bandwidth output to the new bandwidths representation. |
| src/services/compare.jl | Updates State comparison to use refBandwidths. |
| src/services/AbstractDFG.jl | Implements deprecation warning for getSolverParams. |
| src/entities/equality.jl | Updates generated compare union to the renamed belief type. |
| src/entities/State.jl | Introduces topology trait/types; renames and extends stored belief schema; updates state accessors. |
| src/Serialization/StateSerialization.jl | Migrates old-state unpacking to construct StoredHomotopyBelief. |
| src/DistributedFactorGraphs.jl | Changes @format_str / @defStateType visibility to exported. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
This has cross dependency with IIF, so one can't pass without the other. Tested locally so will merge. |
| """ | ||
| [Order 2] The spread/curvature of each node (e.g., Covariance or Precision matrix). | ||
| """ | ||
| shapes::Vector{Matrix{Float64}} = Matrix{Float64}[] # previously `covar` existed but was stored in `bw` (hacky) |
There was a problem hiding this comment.
shapes look a bit ambiguous https://en.wikipedia.org/wiki/Shape_of_a_probability_distribution | https://en.wikipedia.org/wiki/Shape_parameter
So not the best name here.
getSolverParamsas deprecated towords ShouldSolverParamsremain in DFG and be serialized? #1205 (SolverParams is too ingrained to remove one shot)