feature-engine / feature_engine

Feature engineering package with sklearn like functionality
https://feature-engine.trainindata.com/
BSD 3-Clause "New" or "Revised" License
1.88k stars 310 forks source link

Add code examples in outliers module's docstrings #644

Closed datacubeR closed 1 year ago

datacubeR commented 1 year ago

Added examples for the Outliers module:

datacubeR commented 1 year ago

@solegalli why are these tests failing if I haven't modified anything on the source code or the tests?

solegalli commented 1 year ago

It fails because the docs will look to replace anything that is in between {} by a variable that we specify.

If you want to include {} in the code example within the docstrings, you need to write it outside as I do here:

https://github.com/feature-engine/feature_engine/blob/c2f61524cc404cfb661d10345cfbe6e7aa3608bf/feature_engine/datetime/datetime_subtraction.py#L32-L45

And then call it by using the substute function like i do here:

https://github.com/feature-engine/feature_engine/blob/c2f61524cc404cfb661d10345cfbe6e7aa3608bf/feature_engine/datetime/datetime_subtraction.py#L48-L55

And then pass the example in the corresponding part like here:

https://github.com/feature-engine/feature_engine/blob/c2f61524cc404cfb661d10345cfbe6e7aa3608bf/feature_engine/datetime/datetime_subtraction.py#L142

codecov[bot] commented 1 year ago

Codecov Report

Merging #644 (c4f0ca8) into main (c2f6152) will not change coverage. The diff coverage is n/a.

:exclamation: Current head c4f0ca8 differs from pull request most recent head cdcb206. Consider uploading reports for the commit cdcb206 to get more accurate results

@@           Coverage Diff           @@
##             main     #644   +/-   ##
=======================================
  Coverage   97.91%   97.91%           
=======================================
  Files         100      100           
  Lines        3748     3748           
  Branches      726      726           
=======================================
  Hits         3670     3670           
  Misses         29       29           
  Partials       49       49           
Impacted Files Coverage Δ
feature_engine/outliers/artbitrary.py 94.00% <ø> (ø)
feature_engine/outliers/trimmer.py 100.00% <ø> (ø)
feature_engine/outliers/winsorizer.py 100.00% <ø> (ø)

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more