Added varfinite#15
Conversation
I can't seem to find anything that has similar functionality to meanfinite but for standard deviations and so have written up what I've been using here.
Changed instances of `meanfinite(A, region)` to `meanfinite(A, dims=region)` to stop the depreciation warnings during tests.
Codecov Report
@@ Coverage Diff @@
## master #15 +/- ##
==========================================
- Coverage 90.96% 89.94% -1.02%
==========================================
Files 5 5
Lines 177 189 +12
==========================================
+ Hits 161 170 +9
- Misses 16 19 +3
Continue to review full report at Codecov.
|
|
I've just copied over this fix for the 1.0 problem shared with meanfinite. I don't really understand the todo comment about replacing with |
timholy
left a comment
There was a problem hiding this comment.
This looks great, and with one small fix it should be good to go. You might also consider adding a test where n ends up being 1 in some entry, and checking that the returned value is also NaN.
With regards to Returns:
help?> Returns
search: Returns return
f = Returns(value)
Create a callable f such that f(args...; kw...) === value holds.
Examples
≡≡≡≡≡≡≡≡≡≡
julia> f = Returns(42);
julia> f(1)
42
julia> f("hello", x=32)
42
julia> f.value
42
│ Julia 1.7
│
│ Returns requires at least Julia 1.7.so we can't implement it until this package requires at least Julia 1.7 (or depends on Compat).
Test now checks for only one valid value (->\sigma=NaN).
|
Thanks for an excellent contribution! v0.1.4 is on the way: JuliaRegistries/General#44913 |
|
Thanks for your help! I look forward to contributing more in the future |
Reimplemented stdfinite suggested here as varfinite using the new style (which does look a lot better).
Checked and the new method is about twice as fast on a 50x60x70 array and allocates about 30% less memory.
I've also updated the tests for meanfinite, changing
meanfinite(A, region)tomeanfinite(A, dims=region), to stop the depreciation warnings during the tests. I've put these in a different commit in case these it was meant to be that way (apologies if that is the case).Thanks!