Skip to content

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

Merged
jnothman merged 6 commits intoscikit-learn:masterfrom
NicolasHug:remove_assert_equal
Jul 2, 2019
Merged

[MRG] MNT removing assert_equal, etc -- continued#14232
jnothman merged 6 commits intoscikit-learn:masterfrom
NicolasHug:remove_assert_equal

Conversation

@NicolasHug
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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