Skip to content

Commit b93bc59

Browse files
authored
Julia v1.8 Support (#82)
* Branch with segfault on 1.8 * Tests pass on 1.8
1 parent e026147 commit b93bc59

File tree

6 files changed

+21
-15
lines changed

6 files changed

+21
-15
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ jobs:
1111
matrix:
1212
version:
1313
- '1.6'
14-
- '^1.7.0-0'
14+
- '1'
15+
- '^1.8.0-0'
1516
os:
1617
- ubuntu-latest
1718
- macOS-latest

Project.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "QuasiArrays"
22
uuid = "c4ea9172-b204-11e9-377d-29865faadc5c"
33
authors = ["Sheehan Olver <[email protected]>"]
4-
version = "0.9"
4+
version = "0.9.1"
55

66
[deps]
77
ArrayLayouts = "4c555306-a7a7-4459-81d9-ec55ddd5c99a"
@@ -12,9 +12,9 @@ LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1212
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
1313

1414
[compat]
15-
ArrayLayouts = "0.7.6"
15+
ArrayLayouts = "0.7.6, 0.8"
1616
DomainSets = "0.5"
17-
FillArrays = "0.12"
17+
FillArrays = "0.12, 0.13"
1818
LazyArrays = "0.22.2"
1919
StaticArrays = "1"
2020
julia = "1.6"

src/QuasiArrays.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ import Base.Broadcast: materialize, materialize!, BroadcastStyle, AbstractArrayS
3636
newindex, broadcastable, preprocess, _eachindex, _broadcast_getindex, broadcast_shape,
3737
DefaultArrayStyle, axistype, throwdm, instantiate, combine_eltypes, eltypes, combine_styles
3838

39-
import LinearAlgebra: transpose, adjoint, checkeltype_adjoint, checkeltype_transpose, Diagonal,
39+
import LinearAlgebra: transpose, adjoint, Diagonal,
4040
AbstractTriangular, pinv, inv, promote_leaf_eltypes, power_by_squaring,
4141
integerpow, schurpow, tr, factorize, copy_oftype, rank, dot
4242

src/abstractquasiarray.jl

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -295,12 +295,9 @@ similar(a::AbstractQuasiArray, ::Type{T}) where {T} = simila
295295
similar(a::AbstractQuasiArray{T}, dims::Tuple) where {T} = similar(a, T, dims)
296296
similar(a::AbstractQuasiArray{T}, dims::QuasiDimOrInd...) where {T} = similar(a, T, dims)
297297
similar(a::AbstractQuasiArray, ::Type{T}, dims::QuasiDimOrInd...) where {T} = similar(a, T, dims)
298-
similar(::Type{<:AbstractQuasiArray{T}}, shape::NTuple{N,AbstractQuasiOrVector}) where {N,T} =
299-
QuasiArray{T,N}(undef, convert.(AbstractVector, shape))
300-
similar(a::AbstractQuasiArray, ::Type{T}, dims::NTuple{N,AbstractQuasiOrVector}) where {T,N} =
301-
QuasiArray{T,N}(undef, convert.(AbstractVector, dims))
302-
similar(a::AbstractQuasiArray, ::Type{T}, dims::Vararg{AbstractQuasiOrVector,N}) where {T,N} =
303-
QuasiArray{T,N}(undef, convert.(AbstractVector, dims))
298+
similar(::Type{<:AbstractQuasiArray{T}}, shape::NTuple{N,AbstractQuasiOrVector}) where {N,T} = QuasiArray{T,N}(undef, shape)
299+
similar(a::AbstractQuasiArray, ::Type{T}, dims::NTuple{N,AbstractQuasiOrVector}) where {T,N} = QuasiArray{T,N}(undef, dims)
300+
similar(a::AbstractQuasiArray, ::Type{T}, dims::Vararg{AbstractQuasiOrVector,N}) where {T,N} = QuasiArray{T,N}(undef, dims)
304301

305302
similar(a::AbstractQuasiArray{T}, m::Int) where {T} = Vector{T}(undef, m)
306303
similar(a::AbstractQuasiArray, T::Type, dims::Dims{N}) where {N} = Array{T,N}(undef, dims)

src/indices.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ copy(d::Inclusion) = d
169169
==(A::Inclusion, B::Inclusion) = A.domain == B.domain
170170
domain(A::Inclusion) = A.domain
171171
domain(A::AbstractUnitRange) = A
172+
domain(A::IdentityUnitRange) = A.indices
172173
axes(S::Inclusion) = (S,)
173174
axes1(S::Inclusion) = S
174175
axes(S::Inclusion{<:Any,<:OneTo}) = (S.domain,)

src/quasiarray.jl

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,13 @@ QuasiArray(par::AbstractArray) = QuasiArray(par, axes(par))
6666
QuasiMatrix(par::AbstractArray) = QuasiMatrix(par, axes(par))
6767
QuasiVector(par::AbstractArray) = QuasiVector(par, axes(par))
6868

69+
QuasiArray{T,N,AXES}(::UndefInitializer, axes::NTuple{N,AbstractQuasiOrVector}) where {T,N,AXES} =
70+
QuasiArray{T,N,AXES}(undef, map(domain,axes))
71+
QuasiArray{T,N}(::UndefInitializer, axes::NTuple{N,AbstractQuasiOrVector}) where {T,N} =
72+
QuasiArray{T,N}(undef, map(domain,axes))
73+
QuasiArray{T}(::UndefInitializer, axes::NTuple{N,AbstractQuasiOrVector}) where {T,N} =
74+
QuasiArray{T}(undef, map(domain,axes))
75+
6976
QuasiArray{T,N,AXES}(par::AbstractArray{T,N}, axes::NTuple{N,AbstractQuasiOrVector}) where {T,N,AXES} =
7077
QuasiArray{T,N,AXES}(par, map(domain,axes))
7178
QuasiArray{T,N}(par::AbstractArray{T,N}, axes::NTuple{N,AbstractQuasiOrVector}) where {T,N} =
@@ -83,10 +90,10 @@ QuasiVector(par::AbstractVector{T}, axes::AbstractArray) where {T} =
8390
QuasiVector(par, (axes,))
8491

8592

86-
QuasiArray(a::AbstractQuasiArray{T}) where T = QuasiArray{T}(a[map(collect,axes(a))...], axes(a))
87-
QuasiArray{T}(a::AbstractQuasiArray) where T = QuasiArray(convert(AbstractArray{T},a[map(collect,axes(a))...]), axes(a))
88-
QuasiArray{T,N}(a::AbstractQuasiArray{<:Any,N}) where {T,N} = QuasiArray(convert(AbstractArray{T,N},a[map(collect,axes(a))...]), axes(a))
89-
QuasiArray{T,N,AXES}(a::AbstractQuasiArray{<:Any,N}) where {T,N,AXES} = QuasiArray{T,N,AXES}(Array{T}(a), axes(a))
93+
QuasiArray(a::AbstractQuasiArray{T}) where T = QuasiArray{T}(a[map(collect,axes(a))...], map(domain,axes(a)))
94+
QuasiArray{T}(a::AbstractQuasiArray) where T = QuasiArray(convert(AbstractArray{T},a[map(collect,axes(a))...]), map(domain,axes(a)))
95+
QuasiArray{T,N}(a::AbstractQuasiArray{<:Any,N}) where {T,N} = QuasiArray(convert(AbstractArray{T,N},a[map(collect,axes(a))...]), map(domain,axes(a)))
96+
QuasiArray{T,N,AXES}(a::AbstractQuasiArray{<:Any,N}) where {T,N,AXES} = QuasiArray{T,N,AXES}(Array{T}(a), map(domain,axes(a)))
9097
QuasiMatrix(a::AbstractQuasiMatrix) = QuasiArray(a)
9198
QuasiVector(a::AbstractQuasiVector) = QuasiArray(a)
9299

0 commit comments

Comments
 (0)