Skip to content

Commit c43c715

Browse files
committed
fix rendering of constraints in describe()
1 parent fd1ba09 commit c43c715

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/constraints/channel.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const description = """
1+
const description_channel = """
22
The channel constraint establishes a bijective correspondence between two sets of variables. This means that each value in the first set of variables corresponds to a unique value in the second set, and vice versa.
33
"""
44

@@ -11,7 +11,7 @@ Return `true` if the channel constraint is satisfied, `false` otherwise. The cha
1111
- `list::Union{AbstractVector, Tuple}`: list of values to check.
1212
1313
## Variants
14-
- `:channel`: $description
14+
- `:channel`: $description_channel
1515
```julia
1616
concept(:channel, x; dim=1, id=nothing)
1717
concept(:channel)(x; dim=1, id=nothing)

src/usual_constraints.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Adding a new constraint is as simple as defining a new function with the same na
99
@usual concept_all_different(x; vals=nothing) = xcsp_all_different(list=x, except=vals)
1010
```
1111
"""
12-
const USUAL_CONSTRAINTS = Dict{Symbol, Constraint}(:always_true => Constraint())
12+
const USUAL_CONSTRAINTS = Dict{Symbol, Constraint}()
1313

1414
"""
1515
describe(constraints::Dict{Symbol,Constraint}=USUAL_CONSTRAINTS; width=150)
@@ -41,6 +41,8 @@ function describe(constraints::Dict{Symbol, Constraint} = USUAL_CONSTRAINTS; wid
4141
)
4242
end
4343

44+
describe(s::Symbol) = USUAL_CONSTRAINTS[s].description
45+
4446
"""
4547
extract_parameters(s::Symbol, constraints_dict=USUAL_CONSTRAINTS; parameters=ConstraintCommons.USUAL_CONSTRAINT_PARAMETERS)
4648

0 commit comments

Comments
 (0)