Closed willtebbutt closed 1 year ago
Yeah no idea why I did this... This should be changed...
Cool. We should add a test when we do. I think we should probably do a more general audit, but we shouldn't block this change in the short-term.
@molet do you have any other examples of kernels where you'd have thought things should just work out-of-the-box with non-numeric data types and they don't?
_wrap
is another example (where we initially came across this)
Restricted to AbstractVector{<:Real}
and AbstractMatrix{<:Real}
Although there might be some exceptions like kernels in constant.jl
, I think in general it is a good approach to require numeric types for most of the kernels.
So far, I successfully used FunctionTransform
for many situations when I needed to convert a non-numeric type to a numeric one to be able to use specific numeric type based kernels. I think this is a good practice.
Therefore, I would rather focus on making some transform functions more general and let them take non-numerical types: SelectTransform
and FunctionTransform
would definitely need this feature (so we might want to change this line as well to be more general).
Although there might be some exceptions like kernels in
constant.jl
, I think in general it is a good approach to require numeric types for most of the kernels.
If this is the desired interface it would also be good to document it.
Although there might be some exceptions like kernels in constant.jl, I think in general it is a good approach to require numeric types for most of the kernels.
I think that's already true with the kappa
function. But for things like Transform
and Metric
types, this should not be the case. We aim at being as agnostic as possible to the type of data.
I believe that this has been resolved via #480 so will close this issue. Please let me know if there's anything missing.
@theogf do you know why our
Delta
metric is constrained to work for numeric-ish types? Should it not work for anything that has==
defined on it?cc @glennmoy