Skip to content

Commit

Permalink
Add version check for reduced_indices
Browse files Browse the repository at this point in the history
  • Loading branch information
timholy committed Mar 25, 2017
1 parent 24dea7c commit d1857f1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/core.jl
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,13 @@ end
# Note that we only extend the following two methods, and then have it
# dispatch to package-local `reduced_indices` and `reduced_indices0`
# methods. This avoids a whole slew of ambiguities.
Base.reduced_indices(A::AxisArray, region) = reduced_indices(axes(A), region)
Base.reduced_indices0(A::AxisArray, region) = reduced_indices0(axes(A), region)
if VERSION == v"0.5.0"
Base.reduced_dims(A::AxisArray, region) = reduced_indices(axes(A), region)
Base.reduced_dims0(A::AxisArray, region) = reduced_indices0(axes(A), region)
else
Base.reduced_indices(A::AxisArray, region) = reduced_indices(axes(A), region)
Base.reduced_indices0(A::AxisArray, region) = reduced_indices0(axes(A), region)
end

reduced_indices{N}(axs::Tuple{Vararg{Axis,N}}, ::Tuple{}) = axs
reduced_indices0{N}(axs::Tuple{Vararg{Axis,N}}, ::Tuple{}) = axs
Expand Down

0 comments on commit d1857f1

Please sign in to comment.