Skip to content

Commit

Permalink
Add a simple test for this specific issue, and a fix to unwrap_broadc…
Browse files Browse the repository at this point in the history
…asted.
  • Loading branch information
rofinn committed Sep 5, 2022
1 parent 596c163 commit 46db5c9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/broadcast.jl
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ end

function unwrap_broadcasted(bc::Broadcasted{KeyedStyle{S}}) where {S}
inner_args = map(unwrap_broadcasted, bc.args)
Broadcasted{S}(bc.f, inner_args)
Broadcasted{S}(bc.f, inner_args, axes(bc))
end
unwrap_broadcasted(x) = x
unwrap_broadcasted(x::KeyedArray) = parent(x)
Expand Down
11 changes: 11 additions & 0 deletions test/_basic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,17 @@ end
@test_throws Exception unify_keys((1:2,), ([3,4],))

end
@testset "https://github.com/mcabbott/AxisKeys.jl/issues/128" begin
using LinearAlgebra

# Really simple test that broadcasting with linalg array types works.
v = rand(10)
σ = wrapdims(v; time=-4:5)
L = LowerTriangular(reshape(1.0:1.0:100, (10, 10)))
σ .* L
v .* L
@test σ .* L v .* L
end
end
@testset "bitarray" begin

Expand Down

0 comments on commit 46db5c9

Please sign in to comment.