Skip to content

Commit 7b421d0

Browse files
committed
fix: Handle case where vmins/vmaxs contain only one value but should apply to all columns
1 parent 3e3631a commit 7b421d0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/methods.jl

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ function sanitize(var; replace_invalid=true, kwargs...)
1515
if replace_invalid
1616
vmins = valid_min(var)
1717
vmaxs = valid_max(var)
18-
# Apply filtering per column for each value in vmins/vmaxs
19-
for i in eachindex(vmins)
20-
vmin = vmins[i]
21-
vmax = vmaxs[i]
18+
# Apply filtering per column with matching vmins/vmaxs values (Handle case where vmins/vmaxs contain only one value)
19+
for i in eachindex(size(v, 2))
20+
vmin = @something get(vmins, i, nothing) only(vmins)
21+
vmax = @something get(vmaxs, i, nothing) only(vmaxs)
2222
v[(v[:, i].<vmin).|(v[:, i].>vmax), i] .= NaN
2323
end
2424
end

0 commit comments

Comments
 (0)