-
Notifications
You must be signed in to change notification settings - Fork 9
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
loose eltype when fillvalue is nothing or missing #24
Conversation
Codecov Report
@@ Coverage Diff @@
## master #24 +/- ##
==========================================
+ Coverage 71.42% 72.09% +0.66%
==========================================
Files 1 1
Lines 42 43 +1
==========================================
+ Hits 30 31 +1
Misses 12 12
Continue to review full report at Codecov.
|
I don't think you have to convert anything; you can just use T = eltype(data)
T = fillvalue isa Union{Missing,Nothing} ? Union{typeof(fillvalue),T} : T in the constructor and use that for the first type parameter of |
🤔 looks like you're right; the padded value doesn't come from Will change accordingly when I find some time. |
indices::NTuple{N,AbstractUnitRange}) where {T,N,I,A} | ||
ndims(data) == N || throw(DimensionMismatch("data and indices should have the same dimension, instead they're $(ndims(data)) and $N.")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now we can't ensure that eltype(data) == T
That was fast, thanks so much for working on this! Much appreciated. |
I think the revision commit does exactly what @timholy indicated, so I'm merging it now |
Yep, perfect to the letter. Really nice work! And thanks for doing it. ❤️ |
Closes #19
Because for Nothing and Missing, T isn't the eltype anymore, we have
to add several methods(eltype, similar) to support it.
This might be good to go, but I'll need to check it more carefully. I was hoping to provide a patch before anyone sees the updates in #19.