-
Notifications
You must be signed in to change notification settings - Fork 114
Extrapolate to missing #199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
|
It's not desirable to be able to extrapolate a However, if Otherwise, the library in general is written in a generic fashion, so it should be very possible to create a data type that is either |
We should support this. But it's not anywhere high on my priority list. Feel free to take the lead, @cstjean 😉. |
(For @tomasaschan, no need for the |
The error comes from this function, attempting to convert @inline function (etp::FilledExtrapolation{T,N})(x::Vararg{Number,N}) where {T,N}
itp = parent(etp)
coefs = coefficients(itp)
Tret = typeof(prod(x) * zero(eltype(coefs)))
if checkbounds(Bool, itp, x...)
@inbounds itp(x...)
else
convert(Tret, etp.fillvalue) # error here
end
end The easy solution is to take out the etpf = @inferred(extrapolate(itpg, NaN))
....
x = @inferred(etpf(dual(-2.5,1))) # fails - it's inferred as Union{Float64, Dual{Float64}}
@test isa(x, Dual) I believe that this Union could have performance consequences? You wrote the Instead, we could easily special-case The "correct" way to extend the current code would be to fix the type computation in |
Ran into this as well. One way that makes sense type-safety-wise is to require the dependent variable (the I might be missing something. |
It would be nice to support extrapolating to
missing
The text was updated successfully, but these errors were encountered: