Skip to content

[MNT] rename MeanNormalisationScaler public name to british spelling#968

Open
favourone wants to merge 1 commit into
feature-engine:mainfrom
favourone:fix/958-mean-normalisation-scaler
Open

[MNT] rename MeanNormalisationScaler public name to british spelling#968
favourone wants to merge 1 commit into
feature-engine:mainfrom
favourone:fix/958-mean-normalisation-scaler

Conversation

@favourone

Copy link
Copy Markdown

Summary

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

Tests

  • python -m pytest tests/test_scaling/test_mean_normalization.py -q — 9 passed
  • python -m pytest tests/test_scaling -q — 9 passed
  • flake8 — passed
  • black --check — passed
  • git diff --check — passed

Part of #958.

@favourone

Copy link
Copy Markdown
Author

The two required CircleCI jobs failed because the California housing dataset download returned HTTP 403 Forbidden. The other 11 checks passed. I do not have permission to rerun the workflow. Could a maintainer please rerun it?

@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 working on this fix. Well done.

Could you explore the possibility of adding a future warning to the old version of the class, so that when a user (or an LLM) use the old class in their projects, they see the warning and revert to the new way of calling it? I added more details in the comments.

I think we should raise this warning, instead of pointing to the backward compatible class in the user guide or docstrings, which we would remove anyways in future releases.

:class:`MeanNormalisationScaler()` only works with non-constant numerical variables.
If the variable is constant, the scaler will raise an error.

``MeanNormalizationScaler`` 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 line from the user docs?

Comment thread docs/index.rst
Feature-engine extends scikit-learn's scaling functionality with the following transformer:

- :doc:`api_doc/scaling/MeanNormalizationScaler`: scale variables using mean normalisation
- :doc:`MeanNormalisationScaler <api_doc/scaling/MeanNormalizationScaler>`: scale variables using mean normalisation

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:`MeanNormalisationScaler <api_doc/scaling/MeanNormalizationScaler>`: scale variables using mean normalisation
- :doc:`<api_doc/scaling/MeanNormalizationScaler>`: scale variables using mean normalisation


More details in the :ref:`User Guide <mean_normalisation_scaler>`.

The ``MeanNormalizationScaler`` spelling remains available as a

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.

I'd remove this from the documentation. If people have legacy code, they'll realise there's been a change with a warning that should raise the class with the american spelling



# Backward-compatible alias for the original American spelling.
MeanNormalizationScaler = MeanNormalisationScaler

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.

Is there a way to trigger a warning when the user calls the class with z instead of s? I though that if instead of equal we used inheritance, then we could add the warning in the init or something like that. Could you research this possibility? Something like MeanNormalizationScaler was deprecated in favour of MeanNormalisationScaler in version 2.0.0 and will be removed in version 2.1.0. To silence the warning, use MeanNormalisationScaler instead.

from tests.estimator_checks.fit_functionality_checks import check_return_empty


def test_mean_normalization_scaler_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.

is this the best way to assess that both classes have the same behaviour? Somehow I thought that we could pass the different classes to all tests using parametrize. We should also test that using the old class raises the future warning.

@solegalli

Copy link
Copy Markdown
Collaborator

The two required CircleCI jobs failed because the California housing dataset download returned HTTP 403 Forbidden. The other 11 checks passed. I do not have permission to rerun the workflow. Could a maintainer please rerun it?

I am aware of this issue. I need to fix it :)

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