From 2ccd1e59c5c279409aa1c8afad1eb3507d9a8642 Mon Sep 17 00:00:00 2001 From: Julius Krumbiegel Date: Sun, 4 Feb 2024 14:04:12 +0100 Subject: [PATCH] fix stack overflow for grid conversion with missings --- src/conversions.jl | 2 +- test/conversions.jl | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/conversions.jl b/src/conversions.jl index 4727f2715f5..aa87c2ae664 100644 --- a/src/conversions.jl +++ b/src/conversions.jl @@ -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 diff --git a/test/conversions.jl b/test/conversions.jl index 4d27bf4de6f..be31c61cc7c 100644 --- a/test/conversions.jl +++ b/test/conversions.jl @@ -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