Skip to content

Commit 858871a

Browse files
committed
fix typos
1 parent 177662a commit 858871a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/arrays.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,14 +168,14 @@ function Base.Broadcast.broadcasted(
168168
"Arrays could not be broadcast to a common size; "*
169169
"got a dimension with lengths $(length(u)) and $(length(v))"))
170170

171-
v_loc_flat = [(ismissing(x) ? missing : findfirst(x, classes(u)), i)
171+
v_loc_flat = [(ismissing(x) ? missing : findfirst(==(x), classes(u)), i)
172172
for (i, x) in enumerate(v)]
173173
any(isequal(0), v_loc_flat) && throw(err_missing_class(cv))
174174

175175
getter((cv_loc, i), dtype) =
176176
_getindex(get(u.prob_given_ref, cv_loc, nothing), i, dtype)
177177
getter(::Tuple{Missing,Any}, dtype) = missing
178-
ret_flat = getter.(v_flat, P)
178+
ret_flat = getter.(v_loc_flat, P)
179179
return reshape(ret_flat, size(u))
180180
end
181181

@@ -274,7 +274,7 @@ const ERR_EMPTY_UNIVARIATE_FINITE = ArgumentError(
274274
"No `UnivariateFinite` object found from which to extract classes. ")
275275

276276
function classes(yhat::AbstractArray{<:Union{Missing,UnivariateFinite}})
277-
i = findfirst(x->!ismissing(x), yhat)
277+
i = findfirst(!ismissing, yhat)
278278
i === nothing && throw(ERR_EMPTY_UNIVARIATE_FINITE)
279279
return classes(yhat[i])
280280
end

src/methods.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ See also `classes`, `support`.
166166
"""
167167
Dist.pdf(::UnivariateFinite, ::Missing) = missing
168168

169-
function Dist.pdf(d::UnivariateFinite, c)
169+
function Dist.pdf(d::UnivariateFinite{S,V,R,P}, c) where {S,V,R,P}
170170
_classes = classes(d)
171171
c in _classes || throw(DomainError("Value $c not in pool. "))
172172
pool = CategoricalArrays.pool(_classes)

0 commit comments

Comments
 (0)