feat: redesign Solution display — single tree, conditional fields, CTBase palette#375
Merged
Conversation
…Base palette
- SolverInfos: iterations/status/message/constraints_violation are now
Union{T, NotProvidedType}, defaulting to NotProvided in build_solution
- show.jl: single tree rooted at "Solution", │/└─ connectors, fmt.muted
for structural chars, separator │ between primal data and solver metadata;
fields absent (NotProvided) are silently omitted
- Remove fixed return-type annotations from the four optional accessors
- test_solution_show: 4 test cases including NotProvided-omission test
- test_empty_dual_model: update "Solver" → "Solution" string check
- docs/solution/overview.md: add "Displaying a solution" section with 4
executable @repl examples (full solver, flow, variable, duals)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Redesigns the
SolutionREPL display for clarity and consistency with the CTBase palette conventions.Before
After
Single tree, no bullet points, fields omitted when not provided:
Flow result (no solver metadata):
Changes
src/Solutions/solution_types.jlSolverInfos:iterations,status,message,constraints_violationare nowUnion{T, Core.NotProvidedType}instead of mandatory concrete types.src/Solutions/build_solution.jlbuild_solutionoverloads: the four fields above default toCore.NotProvided.Union{T, NotProvidedType}).src/Solutions/show.jl│/└─/├─,fmt.mutedfor structural chars,fmt.label/fmt.valuefor content.│separator appears between primal data (objective, variable, duals) and solver metadata (iterations, status, message, cv) when both sections are non-empty.NotProvidedfields are silently omitted.Tests
test_solution_show.jl: 4 test cases, including aNotProvided-omission case.test_empty_dual_model.jl:"Solver"→"Solution"string check.docs/src/solution/overview.md@replexamples.Related
build_solutioncall (requires CTModels beta release) CTFlows.jl#323