Skip to content

Commit

Permalink
Removed unnecessary argument from undergedims
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaBillson committed Sep 10, 2023
1 parent 4e43e11 commit c70b3bb
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/mergedims.jl
Original file line number Diff line number Diff line change
Expand Up @@ -83,22 +83,23 @@ function unmergedims(merged_dims)
end

"""
unmergedims(A::AbstractDimArray, original_dims, merged_dims) => AbstractDimArray
unmergedims(A::AbstractDimArray, original_dims) => AbstractDimArray
Return a new array whose dimensions are restored to their original prior to calling [`mergedims(A, dim_pairs)`](@ref).
"""
function unmergedims(A::AbstractDimArray, original_dims, merged_dims)
function unmergedims(A::AbstractDimArray, original_dims)
merged_dims = dims(A)
unmerged_dims = unmergedims(merged_dims)
reshaped = reshape(data(A), size(unmerged_dims))
permuted = permutedims(reshaped, dimnum(unmerged_dims, original_dims))
return DimArray(permuted, original_dims)
end

"""
unmergedims(s::AbstractDimStack, original_dims, merged_dims) => AbstractDimStack
unmergedims(s::AbstractDimStack, original_dims) => AbstractDimStack
Return a new stack whose dimensions are restored to their original prior to calling [`mergedims(s, dim_pairs)`](@ref).
"""
function unmergedims(s::AbstractDimStack, original_dims, merged_dims)
return map(A -> unmergedims(A, original_dims, merged_dims), s)
function unmergedims(s::AbstractDimStack, original_dims)
return map(A -> unmergedims(A, original_dims), s)
end

function _mergedims(all_dims, dim_pair::Pair, dim_pairs::Pair...)
Expand Down

0 comments on commit c70b3bb

Please sign in to comment.