[MNT] rename Winsoriser public name to british spelling#967
Conversation
solegalli
left a comment
There was a problem hiding this comment.
Hey @favourone
Great job here indeed. I'd like the old version of the class to raise a future warning directing the user to use the new version instead. Could you check how that could work?
| :class:`Winsoriser()` caps maximum and/or minimum values of a variable at automatically | ||
| determined values. | ||
|
|
||
| ``Winsorizer`` remains available as a backward-compatible alias. |
There was a problem hiding this comment.
Could we remove this from the user guide?
|
|
||
| - :doc:`api_doc/outliers/ArbitraryOutlierCapper`: caps maximum and minimum values at user defined values | ||
| - :doc:`api_doc/outliers/Winsorizer`: caps maximum or minimum values using statistical parameters | ||
| - :doc:`Winsoriser <api_doc/outliers/Winsorizer>`: caps maximum or minimum values using statistical parameters |
There was a problem hiding this comment.
| - :doc:`Winsoriser <api_doc/outliers/Winsorizer>`: caps maximum or minimum values using statistical parameters | |
| - :doc:`<api_doc/outliers/Winsorizer>`: caps maximum or minimum values using statistical parameters |
| return feature_names | ||
|
|
||
|
|
||
| # Backward-compatible alias for the original American spelling. |
There was a problem hiding this comment.
Hey @favourone
Could we explore the option of adding a future warning that is raised as soon as the user initialises the old version of the class saying Winsorizer was deprecated in favour of Winsoriser in version 2.0.0 and will be removed in version 2.1.0. To silence this warning use Winsoriser instead.
| from feature_engine.outliers import Winsoriser, Winsorizer | ||
|
|
||
|
|
||
| def test_winsorizer_is_backward_compatible_alias(): |
There was a problem hiding this comment.
Hey @favourone is this the best way to ensure both classes are identical? Or should we use parametrize to test both classes in all tests?
Could we also add a test for the warning in the old version of the class?
solegalli
left a comment
There was a problem hiding this comment.
Hi @favourone
This is good to merge. Great work.
Similarly to the other PR, could you please rename rename the files in the user guide and api folder to MeanNormalisationScalerWinsoriser.rst and then update the toctrees that reference them to propagate the spelling to the docs URL?
Thanks a lot!
| feature_names = feature_names + self._get_new_features_name() | ||
| return feature_names | ||
|
|
||
|
|
There was a problem hiding this comment.
| # TODO: remove in version 2.1.0 |
Summary
Winsoriseras the preferred public class name.Winsorizeras a backward-compatible alias.feature_engine.outliers.Tests
python -m pytest tests/test_outliers/test_winsorizer.py -q— 27 passedpython -m pytest tests/test_outliers -q— 60 passedflake8— passedgit diff --check— passedPart of #958.