Skip to content

Commit

Permalink
Update compats and clean up code
Browse files Browse the repository at this point in the history
  • Loading branch information
Tokazama committed May 25, 2020
1 parent 19a7e32 commit 0f3cef0
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 61 deletions.
4 changes: 4 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ PrettyTables = "0.9"
StaticArrays = "0.12"
StaticRanges = "0.6"
julia = "1"
TableTraits = "1"
TableTraitsUtils = "1"
Tables = "1"


[extras]
IntervalSets = "8197267c-284f-5f27-9208-e0e47529a953"
Expand Down
4 changes: 0 additions & 4 deletions docs/src/compatibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,3 @@ In other words, the current version can only support multi-mapping multiple `Abs
Indexing via named dimensions is supported via the [NamedDims.jl](https://github.com/invenia/NamedDims.jl) package.
[`NIArray`](@ref) assists in constructing arrays that have both named dimensions and a subtype of `AbstractAxis` along each axis.

## OffsetArrays

Many of the tests used for `OffsetArrays` package have been incorporated into the tests of `AxisIndices` to ensure compatibility.

2 changes: 1 addition & 1 deletion src/AxisCore/AxisCore.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ using StaticRanges: can_set_first, can_set_last, can_set_length, same_type,
checkindexlo, checkindexhi, OneToUnion, grow_first!, grow_last!, resize_last,
resize_last!, shrink_last!

using StaticRanges: Static, Fixed, Dynamic, Staticness
using StaticRanges: Static, Fixed, Dynamic, Staticness, Length
using StaticArrays
using AxisIndices.PrettyArrays

Expand Down
2 changes: 2 additions & 0 deletions src/AxisCore/abstractaxis.jl
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,8 @@ function StaticRanges.set_length(x::AbstractSimpleAxis{V,Vs}, len) where {V,Vs}
return unsafe_reconstruct(x, StaticRanges.set_length(values(x), len))
end

StaticRanges.Length(::Type{<:AbstractAxis{K,Ks,V,Vs}}) where {K,Ks,V,Vs} = Length(Vs)

###
### step
###
Expand Down
1 change: 1 addition & 0 deletions src/AxisCore/abstractaxisindices.jl
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,4 @@ function Base.reverse(x::AbstractAxisIndices{T,N}; dims::Integer) where {T,N}
end
return unsafe_reconstruct(x, p, axs)
end

52 changes: 0 additions & 52 deletions src/AxisCore/offsetarray.jl

This file was deleted.

5 changes: 1 addition & 4 deletions src/AxisCore/traits.jl
Original file line number Diff line number Diff line change
Expand Up @@ -403,14 +403,11 @@ A subtype of `AxisIndicesStyle` indicating that the axis is a always defaults to
"""
struct KeyedStyle{S} <: AxisIndicesStyle end

KeyedStyle(x) = KeyedStyle(AxisIndicesStyle(x))
KeyedStyle(S::AxisIndicesStyle) = KeyedStyle{S}()
KeyedStyle(S::IndicesCollection) = KeyedStyle{KeysCollection()}()
KeyedStyle(S::IndexElement) = KeyedStyle{KeyElement()}()

#function AxisIndicesStyle(::Type{<:AbstractOffsetAxis}, ::Type{T}) where {T}
# return KeyedStyle(AxisIndicesStyle(T))
#end

is_element(::Type{KeyedStyle{T}}) where {T} = is_element(T)

to_index(::KeyedStyle{S}, axis, arg) where {S} = to_index(S, axis, arg)
Expand Down
1 change: 1 addition & 0 deletions src/Math/matmul.jl
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,4 @@ end
function Base.:*(a::AbstractAxisIndices{T,2,<:CoVector}, b::AbstractAxisIndices{S,1}) where {T,S}
return *(parent(a), parent(b))
end

2 comments on commit 0f3cef0

@Tokazama
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request updated: JuliaRegistries/General/15322

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.3.12 -m "<description of version>" 0f3cef0775a2f1aeec19624b20eba3fe940469ed
git push origin v0.3.12

Please sign in to comment.