Skip to content

Commit cb5e5cc

Browse files
Move to StaticArraysCore
Requires `similar_type` in StaticArraysCore
1 parent d2ca535 commit cb5e5cc

File tree

3 files changed

+21
-20
lines changed

3 files changed

+21
-20
lines changed

Project.toml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,27 @@ authors = ["Chris Rackauckas <[email protected]>"]
44
version = "1.10.2"
55

66
[deps]
7-
ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"
8-
ArrayInterfaceStaticArrays = "b0d46f97-bff5-4637-a19a-dd75974142cd"
7+
ArrayInterfaceCore = "30b0a656-2188-435a-8636-2ec0e6a096e2"
8+
ArrayInterfaceStaticArraysCore = "dd5226c6-a4d4-4bc7-8575-46859f9c95b9"
99
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
1010
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1111
MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
12-
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
12+
StaticArraysCore = "1e83bf80-4336-4d27-bf5d-d5a4f845583c"
1313

1414
[compat]
15-
ArrayInterface = "2.8, 3.0, 4, 5, 6"
16-
ArrayInterfaceStaticArrays = "0.1"
15+
ArrayInterfaceCore = "0.1.13"
16+
ArrayInterfaceStaticArraysCore = "0.1"
1717
ChainRulesCore = "1"
1818
MacroTools = "0.5"
19-
StaticArrays = "0.10, 0.11, 0.12, 1.0"
19+
StaticArraysCore = "1"
2020
julia = "1.6"
2121

2222
[extras]
2323
ChainRulesTestUtils = "cdddcdb0-9152-4a09-a978-84456f9df70a"
2424
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
2525
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
26+
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
2627
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
2728

2829
[targets]
29-
test = ["Test", "OrdinaryDiffEq", "InteractiveUtils", "ChainRulesTestUtils"]
30+
test = ["Test", "OrdinaryDiffEq", "InteractiveUtils", "ChainRulesTestUtils", "StaticArrays"]

src/LabelledArrays.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module LabelledArrays
22

3-
using LinearAlgebra, StaticArrays, ArrayInterface
3+
using LinearAlgebra, StaticArraysCore, ArrayInterfaceCore, ArrayInterfaceStaticArraysCore
44

55
include("slarray.jl")
66
include("larray.jl")

src/slarray.jl

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
struct SLArray{S, T, N, L, Syms} <: StaticArray{S, T, N}
2-
__x::SArray{S, T, N, L}
1+
struct SLArray{S, T, N, L, Syms} <: StaticArraysCore.StaticArray{S, T, N}
2+
__x::StaticArraysCore.SArray{S, T, N, L}
33
#SLArray{Syms}(__x::StaticArray{S,T,N}) where {S,N,Syms,T} = new{S,N,Syms,T}(__x)
4-
function SLArray{S, T, N, Syms}(__x::SArray) where {S, T, N, Syms}
4+
function SLArray{S, T, N, Syms}(__x::StaticArraysCore.SArray) where {S, T, N, Syms}
55
new{S, T, N, length(__x), Syms}(convert.(T, __x))
66
end
7-
function SLArray{S, Syms}(__x::SArray{S, T, N, L}) where {S, T, N, L, Syms}
7+
function SLArray{S, Syms}(__x::StaticArraysCore.SArray{S, T, N, L}) where {S, T, N, L, Syms}
88
new{S, T, N, L, Syms}(__x)
99
end
10-
function SLArray{S, T, Syms}(__x::SArray{S, T, N, L}) where {S, T, N, L, Syms}
10+
function SLArray{S, T, Syms}(__x::StaticArraysCore.SArray{S, T, N, L}) where {S, T, N, L, Syms}
1111
new{S, T, N, L, Syms}(__x)
1212
end
1313
function SLArray{S, Syms}(x::Tuple) where {S, Syms}
14-
__x = SArray{S}(x)
14+
__x = StaticArraysCore.SArray{S}(x)
1515
SLArray{S, Syms}(__x)
1616
end
1717
function SLArray{S, T, Syms}(x::Tuple) where {S, T, Syms}
18-
__x = SArray{S, T}(x)
18+
__x = StaticArraysCore.SArray{S, T}(x)
1919
SLArray{S, T, Syms}(__x)
2020
end
2121
function SLArray{S, T, N, L, Syms}(x::Tuple) where {S, T, N, L, Syms}
22-
__x = SArray{S, T, N, L}(x)
22+
__x = StaticArraysCore.SArray{S, T, N, L}(x)
2323
new{S, T, N, L, Syms}(__x)
2424
end
2525
end
@@ -35,7 +35,7 @@ function Base.convert(::Type{NamedTuple},
3535
end
3636
Base.keys(x::SLArray{S, T, N, L, Syms}) where {S, T, N, L, Syms} = Syms
3737

38-
function StaticArrays.similar_type(::Type{SLArray{S, T, N, L, Syms}}, T2,
38+
function StaticArraysCore.similar_type(::Type{SLArray{S, T, N, L, Syms}}, T2,
3939
::Size{S}) where {S, T, N, L, Syms}
4040
SLArray{S, T2, N, L, Syms}
4141
end
@@ -156,7 +156,7 @@ function StaticArrays.similar_type(::Type{SLArray{S, T, N, L, Syms}}, ::Type{New
156156
if n == L
157157
SLArray{Tuple{NewSize...}, NewElType, length(NewSize), L, Syms}
158158
else
159-
SArray{Tuple{NewSize...}, NewElType, length(NewSize), n}
159+
StaticArraysCore.SArray{Tuple{NewSize...}, NewElType, length(NewSize), n}
160160
end
161161
end
162162

@@ -232,15 +232,15 @@ julia> y = EFG(1.0,2.5,3.0,5.0)
232232
2.5 5.0
233233
234234
julia> y.g
235-
3-element view(reshape(::StaticArrays.SArray{Tuple{2,2},Float64,2,4}, 4), 2:4) with eltype Float64:
235+
3-element view(reshape(::StaticArrays.StaticArraysCore.SArray{Tuple{2,2},Float64,2,4}, 4), 2:4) with eltype Float64:
236236
2.5
237237
3.0
238238
5.0
239239
240240
julia> Arr = @SLArray (2, 2) (a = (2, :), b = 3);
241241
julia> z = Arr(1, 2, 3, 4);
242242
julia> z.a
243-
2-element view(::StaticArrays.SArray{Tuple{2,2},Int64,2,4}, 2, :) with eltype Int64:
243+
2-element view(::StaticArrays.StaticArraysCore.SArray{Tuple{2,2},Int64,2,4}, 2, :) with eltype Int64:
244244
2
245245
4
246246
```

0 commit comments

Comments
 (0)