Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump compat of DimensionalData #3707

Merged
merged 4 commits into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ DimensionalData = "0703355e-b756-11e9-17c0-8b28908087d0"
JuMPDimensionalDataExt = "DimensionalData"

[compat]
DimensionalData = "0.24, 0.25"
DimensionalData = "0.24, 0.25, 0.26.2"
LinearAlgebra = "<0.0.1, 1.6"
MacroTools = "0.5"
MathOptInterface = "1.25.2"
Expand Down
2 changes: 1 addition & 1 deletion docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ CDDLib = "=0.9.2"
CSV = "0.10"
Clarabel = "=0.6.0"
DataFrames = "1"
DimensionalData = "0.24"
DimensionalData = "0.26.2"
Distributions = "0.25"
Documenter = "=1.2.1"
DocumenterCitations = "1"
Expand Down
31 changes: 20 additions & 11 deletions docs/src/extensions/DimensionalData.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,16 @@ julia> @variable(
x[i = 2:4, j = ["a", "b"]] >= i,
container = DimensionalData.DimArray,
)
3×2 DimArray{VariableRef,2} with dimensions:
Dim{:i} Sampled{Int64} 2:4 ForwardOrdered Regular Points,
Dim{:j} Categorical{String} String["a", "b"] ForwardOrdered
"a" "b"
2 x[2,a] x[2,b]
3 x[3,a] x[3,b]
4 x[4,a] x[4,b]
╭─────────────────────────────╮
│ 3×2 DimArray{VariableRef,2} │
├─────────────────────────────┴─────────────────── dims ┐
↓ i Sampled{Int64} 2:4 ForwardOrdered Regular Points,
→ j Categorical{String} ["a", "b"] ForwardOrdered
└───────────────────────────────────────────────────────┘
↓ → "a" "b"
2 x[2,a] x[2,b]
3 x[3,a] x[3,b]
4 x[4,a] x[4,b]
```

Here `x` is a `DimensionalData.Dim` array object, so indexing uses the
Expand All @@ -69,8 +72,11 @@ julia> @expression(
sum(x[At(i), At(j)] for i in 2:4),
container = DimensionalData.DimArray,
)
2-element DimArray{AffExpr,1} with dimensions:
Dim{:j} Categorical{String} String["a", "b"] ForwardOrdered
╭───────────────────────────────╮
│ 2-element DimArray{AffExpr,1} │
├───────────────────────────────┴───────────── dims ┐
↓ j Categorical{String} ["a", "b"] ForwardOrdered
└───────────────────────────────────────────────────┘
"a" x[2,a] + x[3,a] + x[4,a]
"b" x[2,b] + x[3,b] + x[4,b]
```
Expand All @@ -82,8 +88,11 @@ julia> @constraint(
expr[At(j)] <= 1,
container = DimensionalData.DimArray,
)
2-element DimArray{ConstraintRef{Model, MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.LessThan{Float64}}, ScalarShape},1} with dimensions:
Dim{:j} Categorical{String} String["a", "b"] ForwardOrdered
╭──────────────────────────────────────────────────────────────────────────────╮
│ 2-element DimArray{ConstraintRef{Model, MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.LessThan{Float64}}, ScalarShape},1} │
├──────────────────────────────────────────────────────────────────────── dims ┤
↓ j Categorical{String} ["a", "b"] ForwardOrdered
└──────────────────────────────────────────────────────────────────────────────┘
"a" x[2,a] + x[3,a] + x[4,a] ≤ 1
"b" x[2,b] + x[3,b] + x[4,b] ≤ 1
```
Expand Down
Loading