solved or count if no statelabel#1255
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #1255 +/- ##
===========================================
- Coverage 81.25% 81.21% -0.05%
===========================================
Files 50 50
Lines 2700 2704 +4
===========================================
+ Hits 2194 2196 +2
- Misses 506 508 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
4959b83 to
98c8dbe
Compare
|
My pattern here was that it follows the rest of DFG where you get an error if you ask for a node that does not exist. As an example, it is the same pattern if you ask for a state on a variable that does not exist you get an error that the variable does not exist. |
|
okay, but how then do we solve this problem: fg = initfg()
addVariable!(fg, :x0, Position1)
isSolved(fg, :x0)
isIinitialized(fg, :x0)
solveCount(fg, :x0)I |
|
Remember a user has no idea what |
|
maybe the verb is wrong, i.e.: listSolved
listInitialized |
|
There still is need for a default stateLabel everywhere -- something like |
|
I don’t know yet. The pattern for getState is to explicitly require a state label, so |
I agree. The get verb should have a consistent signature and behaviour. |
| # 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,) |
There was a problem hiding this comment.
The submersion is a map and has to be explicitly provided. This example of 2 e1 = [1, 0, 0] "partials" shows why:
f(R) = vee(log(R))ᵀ * e₁ # SO(3) -> ℝ¹f(R) = R * e₁ # SO(3) -> S²
| else | ||
| return 0 | ||
| end | ||
| end |
There was a problem hiding this comment.
Note: All functions with deprecated solveKey name is not DFG v1 ready yet and un-exported.
Looking at this again, the verb and noun are both incorrect.
- the noun should match the field name
solves - for the verb we discussed
tally: Calculates value of countable field (ex. number of solves completed)
There was a problem hiding this comment.
tallySolves(v::VariableDFG) should still count the solves across all states though, so no default state_label.
| 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 |
There was a problem hiding this comment.
I would use the direct field access here as discussed (TODO find ref).
For a list alternative we have listStates and can add a whereSolves filter, ie. whereSolves = >(0).
|
Since these functions were deprecated and is not exported, we can probably change the behaviour as in the pr without bumping the minor to v0.30. |
Maybe in higher level helpers, but not in the core API (like |
We should not merge PR in current state, rather update. Just need to update the IIF tests which depend on these functions.
So the solution to the example above becomes? fg = initfg()
addVariable!(fg, :x1, Position1)
@assert !any(listStates(fg)) "nothing should have been solved yet"
@assert 0 === tallyStatesfg) "nothing should have been solved yet"
I'm getting a bit confused in the cross between verb and Noun here.
Do we have a Noun Definition for
Uhmm, I don't fully remember the detail, do we have that captured in a thread somewhere? Do you mean that non-exported features of DFG v1.0 should temporarily be accessed via |
At some stage we discussed how to handle cross platform/language api vs julia field mutations/access, we said we should use the DF EDIT: use ref for in-memory access only (avoids remote queries or mutations). |
yes, see Nouns (from ICRA) |
|
|
|
okay, so I think the definition piece I'm getting tripped up on is: |
No description provided.