In the event that a version 2 is ever released, I think it would be good to have place to discuss potential design changes. Please close this issue if it's inappropriate or not worth discussing :)
To start, I think Sum(Integer) should only accept integer types. The fact that it can accept a real value and round to an integer can cause unexpected behavior, and requires extra code in OnlineStatsBase to handle that condition:
_fit!(o::Sum{T}, x::Real) where {T<:AbstractFloat} = (o.sum += convert(T, x); o.n += 1)
_fit!(o::Sum{T}, x::Real) where {T<:Integer} = (o.sum += round(T, x); o.n += 1) # <- this should be an error
In the event that a version 2 is ever released, I think it would be good to have place to discuss potential design changes. Please close this issue if it's inappropriate or not worth discussing :)
To start, I think
Sum(Integer)
should only accept integer types. The fact that it can accept a real value and round to an integer can cause unexpected behavior, and requires extra code in OnlineStatsBase to handle that condition: