Skip to content

Commit

Permalink
Fix whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
brendanjohnharris authored Mar 7, 2024
1 parent 3314852 commit 0ac2eb0
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/array/methods.jl
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ end
ds = DD.dims(A, _astuple(dims))
# Run one slice with dimensions to get the transformed dim
d_inds = map(d -> rebuild(d, 1), otherdims(A, ds))
example_dims = DD.dims(f(view(A, d_inds...)))
example_dims = length(d_inds) > 0 ? DD.dims(f(view(A, d_inds...))) : ()
replacement_dims = if isnothing(example_dims) || length(example_dims) != length(ds)
map(d -> rebuild(d, NoLookup()), ds)
else
Expand Down Expand Up @@ -390,8 +390,8 @@ end
check_cat_lookups(dims::Dimension...) =
_check_cat_lookups(basetypeof(first(dims)), lookup(dims)...)

# LookupArrays may need adjustment for `cat`
_check_cat_lookups(D, lookups::LookupArray...) = _check_cat_lookup_order(D, lookups...)
# Lookups may need adjustment for `cat`
_check_cat_lookups(D, lookups::Lookup...) = _check_cat_lookup_order(D, lookups...)
_check_cat_lookups(D, l1::NoLookup, lookups::NoLookup...) = true
function _check_cat_lookups(D, l1::AbstractSampled, lookups::AbstractSampled...)
length(lookups) > 0 || return true
Expand Down Expand Up @@ -430,7 +430,7 @@ function _check_cat_lookups(D, ::Irregular, lookups...)
end |> all
end

function _check_cat_lookup_order(D, lookups::LookupArray...)
function _check_cat_lookup_order(D, lookups::Lookup...)
l1 = first(lookups)
length(l1) == 0 && return _check_cat_lookup_order(D, Base.tail(lookups)...)
L = basetypeof(l1)
Expand Down Expand Up @@ -481,8 +481,8 @@ function _vcat_dims(d1::Dimension, ds::Dimension...)
return rebuild(d1, newlookup)
end

# LookupArrays may need adjustment for `cat`
function _vcat_lookups(lookups::LookupArray...)
# Lookups may need adjustment for `cat`
function _vcat_lookups(lookups::Lookup...)
newindex = _vcat_index(lookups...)
return rebuild(lookups[1]; data=newindex)
end
Expand Down Expand Up @@ -520,10 +520,10 @@ end
_vcat_index(A1::NoLookup, A::NoLookup...) = OneTo(mapreduce(length, +, (A1, A...)))
# TODO: handle vcat OffsetArrays?
# Otherwise just vcat. TODO: handle order breaking vcat?
# function _vcat_index(lookup::LookupArray, lookups...)
# function _vcat_index(lookup::Lookup, lookups...)
# _vcat_index(span(lookup), lookup, lookups...)
# end
function _vcat_index(lookup1::LookupArray, lookups::LookupArray...)
function _vcat_index(lookup1::Lookup, lookups::Lookup...)
shifted = map((lookup1, lookups...)) do l
parent(maybeshiftlocus(locus(lookup1), l))
end
Expand Down

0 comments on commit 0ac2eb0

Please sign in to comment.