Skip to content

[MNT] rename Winsoriser public name to british spelling#967

Open
favourone wants to merge 4 commits into
feature-engine:mainfrom
favourone:fix/958-winsoriser
Open

[MNT] rename Winsoriser public name to british spelling#967
favourone wants to merge 4 commits into
feature-engine:mainfrom
favourone:fix/958-winsoriser

Conversation

@favourone

Copy link
Copy Markdown

Summary

  • Add Winsoriser as the preferred public class name.
  • Retain Winsorizer as a backward-compatible alias.
  • Export both names from feature_engine.outliers.
  • Update current API documentation, user guide, and README.
  • Preserve existing documentation paths and anchors for compatibility.
  • Add an explicit identity test for the compatibility alias.

Tests

  • python -m pytest tests/test_outliers/test_winsorizer.py -q — 27 passed
  • python -m pytest tests/test_outliers -q — 60 passed
  • flake8 — passed
  • git diff --check — passed

Part of #958.

@solegalli solegalli left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Comment thread docs/user_guide/outliers/Winsorizer.rst Outdated
:class:`Winsoriser()` caps maximum and/or minimum values of a variable at automatically
determined values.

``Winsorizer`` remains available as a backward-compatible alias.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we remove this from the user guide?

Comment thread docs/index.rst Outdated

- :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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- :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

Comment thread feature_engine/outliers/winsorizer.py Outdated
return feature_names


# Backward-compatible alias for the original American spelling.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread tests/test_outliers/test_winsorizer.py Outdated
from feature_engine.outliers import Winsoriser, Winsorizer


def test_winsorizer_is_backward_compatible_alias():

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 solegalli changed the title [ENH] Add Winsoriser public name [MNT] rename Winsoriser public name to british spelling Jul 23, 2026

@solegalli solegalli left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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


Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# TODO: remove in version 2.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants