polars icon indicating copy to clipboard operation
polars copied to clipboard

Refactor ewm_std and ewm_var to support adjust and bias parameters

Open matteosantama opened this issue 3 years ago • 3 comments

This is a WIP.

I'm still fairly green in Rust, so comments and critiques are welcome!

TODO:

  • [x] Complete the implementation of Series::ewm_var and Series::ewm_std
  • [x] Handle min_periods parameter
  • [x] Expose the bias parameter in py-polars
  • [ ] Write test cases on the Python side.
  • [ ] Better handling of NaNs?

matteosantama avatar Aug 09 '22 15:08 matteosantama

Codecov Report

Merging #4348 (237b974) into master (d5a0aff) will decrease coverage by 58.45%. The diff coverage is 78.84%.

@@            Coverage Diff             @@
##           master   #4348       +/-   ##
==========================================
- Coverage   64.74%   6.29%   -58.46%     
==========================================
  Files         464     422       -42     
  Lines       75733   63303    -12430     
==========================================
- Hits        49034    3983    -45051     
- Misses      26699   59320    +32621     
Impacted Files Coverage Δ
polars/polars-arrow/src/kernels/ewm/mod.rs 0.00% <0.00%> (ø)
polars/polars-arrow/src/kernels/list.rs 83.96% <ø> (+35.84%) :arrow_up:
polars/polars-core/src/series/ops/ewm.rs 0.00% <0.00%> (-57.82%) :arrow_down:
polars/polars-arrow/src/kernels/ewm/variance.rs 92.56% <92.48%> (+34.10%) :arrow_up:
polars/polars-ops/src/frame.rs 0.00% <0.00%> (-100.00%) :arrow_down:
polars/polars-utils/src/mem.rs 0.00% <0.00%> (-100.00%) :arrow_down:
polars/polars-utils/src/sort.rs 0.00% <0.00%> (-100.00%) :arrow_down:
polars/polars-io/src/avro/write.rs 0.00% <0.00%> (-100.00%) :arrow_down:
polars/polars-arrow/src/is_valid.rs 0.00% <0.00%> (-100.00%) :arrow_down:
polars/polars-io/src/parquet/mmap.rs 0.00% <0.00%> (-100.00%) :arrow_down:
... and 416 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

codecov-commenter avatar Aug 09 '22 15:08 codecov-commenter

Thanks @matteosantama. I am a few days off, but I will review this as soon as possible.

ritchie46 avatar Aug 11 '22 07:08 ritchie46

@matteosantama I did a first review and the code seems good to me. Can you finish you todo's and pnig me a again for a final review?

ritchie46 avatar Aug 11 '22 08:08 ritchie46

@matteosantama this can be closed now right?

ritchie46 avatar Aug 23 '22 13:08 ritchie46

@ritchie46

This MR deals with variance and standard deviation, whereas #4501 improved the mean calculation Given the work in #4501, though, this MR is rather stale. I will close it and in the coming week open up a new one that incorporates the improvements from #4501.

matteosantama avatar Aug 23 '22 14:08 matteosantama