Read the limits of the duals at the switching times by label (with a mask of the known limits)
Los mantenedores suelen responder en 1 día
@ocots ya está trabajando en esto.
Desde el 3/11/2026.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
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
- Lenguaje dominante
- Julia
- Estrellas
- 3
- Forks
- 1
- Merge medio
- 8 h
- PR fusionados (30 d)
- 57
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de control-toolbox/CTModels.jl
-
Components with several representations, selected by the modeler (required_form)Posiblemente ocupada @ocots la tomó hace 1 día. Abierto
control-toolbox/CTModels.jl#516 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
[Feature] build_solution from model information, without a full continuous ModelPosiblemente ocupada @ocots la tomó hace 3 días. Abiertofeature
control-toolbox/CTModels.jl#515 · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de control-toolbox/CTModels.jl
Issues similares
-
lux
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
JuliaGraphs/GraphNeuralNetworks.jl#732 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
erfinv(::Float16) and erfcinv(::Float16) are wrong for abs(x) <= 0.75 (erfinv(Float16(0)) == 0.2201)Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
JuliaMath/SpecialFunctions.jl#571 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100