Skip to content

Commit

Permalink
fix stack overflow for grid conversion with missings
Browse files Browse the repository at this point in the history
  • Loading branch information
jkrumbiegel committed Feb 4, 2024
1 parent 67e988b commit 2ccd1e5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/conversions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ convert_arguments(ct::VertexGrid, x::AbstractMatrix, y::AbstractMatrix) = conver
Takes one or two ClosedIntervals `x` and `y` and converts them to closed ranges
with size(z, 1/2).
"""
function convert_arguments(P::GridBased, x::RangeLike, y::RangeLike, z::AbstractMatrix)
function convert_arguments(P::GridBased, x::RangeLike, y::RangeLike, z::AbstractMatrix{<:Number})
convert_arguments(P, to_linspace(x, size(z, 1)), to_linspace(y, size(z, 2)), z)
end

Expand Down
3 changes: 3 additions & 0 deletions test/conversions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,9 @@ end
@test convert_arguments(Heatmap, 0:10, v2, m3) == (collect(0f0:10f0), o2, o3)
@test_throws ErrorException convert_arguments(Heatmap, m1, m2, m3)
@test_throws ErrorException convert_arguments(Heatmap, m1, m2)

# https://github.com/MakieOrg/Makie.jl/issues/3515
@test convert_arguments(Heatmap, 1:8, 1:8, Array{Union{Float64,Missing}}(zeros(8, 8))) == (0.5:8.5, 0.5:8.5, zeros(8, 8))
end
end

Expand Down

0 comments on commit 2ccd1e5

Please sign in to comment.