Skip to content

Rename variables, proposed by issue #257 #324

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

mvargas33
Copy link
Contributor

@mvargas33 mvargas33 commented Sep 14, 2021

Closes #257 as suggested by @bellet . Tests pass as expected.

This refactor is relevant from a user perspective.

Copy link
Member

@terrytangyuan terrytangyuan left a comment

Choose a reason for hiding this comment

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

LGTM. PTAL @bellet

Copy link
Member

@bellet bellet left a comment

Choose a reason for hiding this comment

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

@mvargas33 We should avoid breaking compatibility right away: instead, you should keep older names with 'deprecated' value and have deprecation warnings for the next release (0.7.0), before we remove them permanently in 0.8.0.

See for instance what was done here: #193

@mvargas33
Copy link
Contributor Author

@mvargas33 We should avoid breaking compatibility right away: instead, you should keep older names with 'deprecated' value and have deprecation warnings for the next release (0.7.0), before we remove them permanently in 0.8.0.

See for instance what was done here: #193

@bellet

So, the existing code is not broken anymore. Following #193 I've added a warning mentioning deprecation in each part of the code. These warnings are FutureWarnings in order to show them to end users. If I use DeprecationWarning the warning won't show up unless the user configure their program to show more warnings (according to docs and tested myself).

To take note:

  • The pattern is to change the old name with a 'deprecated' value by default. If its not, the warning is triggered, and the value is assigned to the variable with the new name.
  • The old name must have a value, otherwise some tests get broken, for instance, the check_estimator test from sklearn, checks that all params received in the constructor are set in the Estimator, including the deprecated one, even if it is not used anywhere.
  • All tests have the new name now, not the old one
  • No additional test were made to check if warnings are being triggered
  • Maybe the docs needs an additional modification, just like in [MRG] Uniformize num_dims and add it for LMNN #193, but I did not do modified the docs.

@perimosocordiae perimosocordiae merged commit 17216a7 into scikit-learn-contrib:master Jun 21, 2022
@perimosocordiae
Copy link
Contributor

Changes look good, merging.

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.

Improve consistency in parameter names
4 participants