Skip to content

Commit 1698ebe

Browse files
committed
Clarify arrays can't use kwargs
1 parent 9db0c9a commit 1698ebe

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

docs/src/manual/constraints.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -868,7 +868,7 @@ JuMP.Containers.SparseAxisArray{ConstraintRef{Model, MathOptInterface.Constraint
868868
If you have many index dimensions and a large amount of sparsity, read
869869
[Performance considerations](@ref).
870870

871-
### Forcing the container type
871+
### [Forcing the container type](@id constraint_forcing)
872872

873873
When creating a container of constraints, JuMP will attempt to choose the
874874
tightest container type that can store the constraints. However, because this

docs/src/manual/containers.md

+11-1
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,16 @@ julia> DataFrames.DataFrame(table)
138138
6 │ 2 3 (2, 3)
139139
```
140140

141+
### Keyword indexing
142+
143+
Keyword indexing cannot be used and will throw a `MethodError`:
144+
145+
```jldoctest containers_array
146+
julia> x[i = 2, j = 2]
147+
ERROR: MethodError: no method matching getindex(::Matrix{Tuple{Int64, Int64}}; i=2, j=2)
148+
[...]
149+
```
150+
141151
## DenseAxisArray
142152

143153
A [`Containers.DenseAxisArray`](@ref) is created when the index sets are
@@ -382,7 +392,7 @@ JuMP.Containers.SparseAxisArray{Tuple{Int64, Symbol}, 1, Tuple{Int64}} with 2 en
382392
[3] = (3, :A)
383393
```
384394

385-
## Forcing the container type
395+
## [Forcing the container type](@id container_forcing)
386396

387397
Pass `container = T` to use `T` as the container. For example:
388398
```jldoctest; filter=r"\([1-2], [1-2]\) \=\> [2-4]"

0 commit comments

Comments
 (0)