Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[MRG] MNT removing assert_equal, etc -- continued #14232

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
merged 6 commits into from
Jul 2, 2019

Conversation

NicolasHug
Copy link
Member

Addresses (and closes?) #14215

Follow up to #14222

There are still a few occurrences of np.testing.assert_equal but I guess it's worth keeping: it is used to deeply compare lists.

This PR also deprecates:

  • assert_equal
  • assert_not_equal
  • assert_in
  • assert_not_in
  • assert_greater
  • assert_less
  • assert_greater_equal
  • assert_less_equal

Copy link
Member

@rth rth left a comment

Choose a reason for hiding this comment

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

Thanks for working on this @NicolasHug !

@NicolasHug NicolasHug changed the title [WIP] MNT removing assert_equal, etc -- continued [MRG] MNT removing assert_equal, etc -- continued Jul 1, 2019
assert args_store == [X], ('Incorrect positional arguments passed to '
'func: {args}'.format(args=args_store))

assert not kwargs_store, ('Unexpected keyword arguments passed to '
Copy link
Member

Choose a reason for hiding this comment

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

strictly speaking, not kwargs_store is True if kwargs_store == False, or kwargs is None. I think it's safer if we check it to be exactly what we want.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure I follow: kwargs_store is a dict? We just check that it's empty

You mean you want assert kwargs_store == {}?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah I prefer the assert kwargs_store == {}, but you're right that here it's a dict. So never mind.

This LGTM then.

assert args_store == [X], ('Incorrect positional arguments passed '
'to func: {args}'.format(args=args_store))

assert not kwargs_store, ('Unexpected keyword arguments passed to '
Copy link
Member

Choose a reason for hiding this comment

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

same here

@jnothman jnothman merged commit f3eb9d2 into scikit-learn:master Jul 2, 2019
koenvandevelde pushed a commit to koenvandevelde/scikit-learn that referenced this pull request Jul 12, 2019
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.

4 participants