JuliaStats / TimeSeries.jl

Time series toolkit for Julia
Other
353 stars 69 forks source link

findall: support custom function as argument #488

Closed iblislin closed 3 years ago

iblislin commented 3 years ago
julia> @benchmark findall($cl .> 100)
BenchmarkTools.Trial:
  memory estimate:  10.53 KiB
  allocs estimate:  28
  --------------
  minimum time:     6.108 μs (0.00% GC)
  median time:      7.105 μs (0.00% GC)
  mean time:        8.535 μs (9.45% GC)
  maximum time:     2.347 ms (98.30% GC)
  --------------
  samples:          10000
  evals/sample:     5

julia> @benchmark findall(>(100), $cl)
BenchmarkTools.Trial:
  memory estimate:  2.28 KiB
  allocs estimate:  8
  --------------
  minimum time:     2.064 μs (0.00% GC)
  median time:      2.974 μs (0.00% GC)
  mean time:        3.067 μs (2.51% GC)
  maximum time:     201.347 μs (97.47% GC)
  --------------
  samples:          10000
  evals/sample:     9

Ref https://github.com/JuliaStats/TimeSeries.jl/issues/456#issuecomment-800083464

iblislin commented 3 years ago

cc @findmyway

codecov-io commented 3 years ago

Codecov Report

Merging #488 (996b3ea) into master (ee492a1) will increase coverage by 1.10%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #488      +/-   ##
==========================================
+ Coverage   86.63%   87.74%   +1.10%     
==========================================
  Files          12       12              
  Lines         636      677      +41     
==========================================
+ Hits          551      594      +43     
+ Misses         85       83       -2     
Impacted Files Coverage Δ
src/split.jl 100.00% <100.00%> (ø)
src/modify.jl 100.00% <0.00%> (ø)
src/basemisc.jl 100.00% <0.00%> (ø)
src/readwrite.jl 100.00% <0.00%> (ø)
src/utilities.jl 100.00% <0.00%> (ø)
src/combine.jl 96.70% <0.00%> (+0.19%) :arrow_up:
src/tables.jl 93.33% <0.00%> (+0.31%) :arrow_up:
src/timearray.jl 98.01% <0.00%> (+0.75%) :arrow_up:
src/apply.jl 90.24% <0.00%> (+1.35%) :arrow_up:
src/broadcast.jl 97.36% <0.00%> (+2.92%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update ee492a1...996b3ea. Read the comment docs.

findmyway commented 3 years ago

Thanks for your quick response! 👍