Read the limits of the duals at the switching times by label (with a mask of the known limits)
I maintainer di solito rispondono entro 1 giorno
@ocots ci sta già lavorando.
Dal 3/11/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
Follow-up of #493 (PR #509). Part of control-toolbox/CTFlows.jl#512 (tracking of the constraint duals). Not urgent: no consumer needs it today; open to keep track of the design.
Problem
Since #509, the limits of the duals at the switching times are given by label, SwitchingModel(; duals=Dict(label => (left, right))), but read by component: limits(sw, :path_dual), limits(sw, :state_dual), left_limit(sol, :control_dual, i). The rows of a label whose limits were not given hold NaN.
- The asymmetry: a producer gives the limits of
:c1, a reader must know the rows of:c1(constraint_rows) to find them back. - There is no mask of the known limits, unlike the duals (
DualMasks):NaNis the only signal of "not given", so aNaNreally computed by a producer cannot be told apart from a limit not given (the plot draws both as "no jump", seePlotCase._fill_unknown_limits). For the duals, the mask is the authority andNaNonly a safety net.
Proposal
Do the two together, or neither:
- A reader by label, symmetric of the input, e.g.
dual_limits(sol, model, label) -> (left, right)(one row per switching time, the signed dual for a box label, a scalar per time for a one-row label), throwing aPreconditionErrorwhen the limits oflabelwere not given, asdualdoes; andhas_dual_limits(sol, model, label). - A mask of the known limits per kind in the
SwitchingModel(path, state, control), canonical asDualMasks(nothingwhen every column is known), so that the reader has an authority to decide; serialized like the dual masks (written only when partial).
The plot (#506 / #510) could then read the limits of a row by label instead of by columns.
Why not in #509
A mask without a reader by label would be state that nobody consults; NaN is enough and consistent for data read by component (see the discussion in #509).
Tests
- by label = by component for path and box labels, one-row and vector labels;
- a label without limits throws a
PreconditionError;has_dual_limitsagrees; - the mask: canonical, serialized, a file without it read as before.
🤖 Generated with Claude Code
- Lingua principale
- Julia
- Stelle
- 3
- Fork
- 1
- Merge medio
- 8h
- PR unite (30g)
- 57
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di control-toolbox/CTModels.jl
-
[Feature] build_solution from model information, without a full continuous ModelForse già presa @ocots l’ha presa 2 giorni fa. Apertafeature
control-toolbox/CTModels.jl#515 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di control-toolbox/CTModels.jl
Issue simili
-
backport 1.14 GC
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
I maintainer di solito rispondono entro 1 giorno
-
`binary_focal_loss` throws a `DomainError` when a negative sample has `ŷ = 1`Forse già presa @parth-patel010 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
FluxML/Flux.jl#2818 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
JuliaDiff/TaylorSeries.jl#445 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
control-toolbox/CTActions#139 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
SciML/Optimization.jl#1448 ·
I maintainer di solito rispondono entro 1 giorno