Skip to content

Commit 32a839a

Browse files
Move to StaticArraysCore
Requires `similar_type` in StaticArraysCore
1 parent 9e3fea0 commit 32a839a

File tree

3 files changed

+19
-18
lines changed

3 files changed

+19
-18
lines changed

Project.toml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,30 @@ version = "1.11.1"
55

66
[deps]
77
ArrayInterfaceCore = "30b0a656-2188-435a-8636-2ec0e6a096e2"
8-
ArrayInterfaceStaticArrays = "b0d46f97-bff5-4637-a19a-dd75974142cd"
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
PreallocationTools = "d236fae5-4411-538c-8e31-a6e3d9e00b46"
1414
RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd"
1515

1616
[compat]
1717
ArrayInterfaceCore = "0.1.13"
18-
ArrayInterfaceStaticArrays = "0.1"
18+
ArrayInterfaceStaticArraysCore = "0.1"
1919
ChainRulesCore = "1"
2020
MacroTools = "0.5"
21+
StaticArraysCore = "1"
2122
PreallocationTools = "0.4"
2223
RecursiveArrayTools = "2"
23-
StaticArrays = "1.0"
2424
julia = "1.6"
2525

2626
[extras]
2727
ChainRulesTestUtils = "cdddcdb0-9152-4a09-a978-84456f9df70a"
2828
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
2929
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
30+
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
3031
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
3132

3233
[targets]
33-
test = ["Test", "OrdinaryDiffEq", "InteractiveUtils", "ChainRulesTestUtils"]
34+
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, ArrayInterfaceCore
3+
using LinearAlgebra, StaticArraysCore, ArrayInterfaceCore
44
import RecursiveArrayTools, PreallocationTools
55

66
include("slarray.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
@@ -159,7 +159,7 @@ function StaticArrays.similar_type(::Type{SLArray{S, T, N, L, Syms}}, ::Type{New
159159
if n == L
160160
SLArray{Tuple{NewSize...}, NewElType, length(NewSize), L, Syms}
161161
else
162-
SArray{Tuple{NewSize...}, NewElType, length(NewSize), n}
162+
StaticArraysCore.SArray{Tuple{NewSize...}, NewElType, length(NewSize), n}
163163
end
164164
end
165165

@@ -235,15 +235,15 @@ julia> y = EFG(1.0,2.5,3.0,5.0)
235235
2.5 5.0
236236
237237
julia> y.g
238-
3-element view(reshape(::StaticArrays.SArray{Tuple{2,2},Float64,2,4}, 4), 2:4) with eltype Float64:
238+
3-element view(reshape(::StaticArrays.StaticArraysCore.SArray{Tuple{2,2},Float64,2,4}, 4), 2:4) with eltype Float64:
239239
2.5
240240
3.0
241241
5.0
242242
243243
julia> Arr = @SLArray (2, 2) (a = (2, :), b = 3);
244244
julia> z = Arr(1, 2, 3, 4);
245245
julia> z.a
246-
2-element view(::StaticArrays.SArray{Tuple{2,2},Int64,2,4}, 2, :) with eltype Int64:
246+
2-element view(::StaticArrays.StaticArraysCore.SArray{Tuple{2,2},Int64,2,4}, 2, :) with eltype Int64:
247247
2
248248
4
249249
```

0 commit comments

Comments
 (0)