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

Skip to content

CI fix test in scipy-dev build following deprecation of array elementwise comparison with string #25316

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 1 commit into from
Jan 9, 2023

Conversation

lesteve
Copy link
Member

@lesteve lesteve commented Jan 6, 2023

What does this implement/fix? Explain your changes.

This fixes one of the issue seen in #25202

In numpy dev version, this is now an error.

import numpy as np
arr = np.array([1, 2])

bool(arr != 'deprecated')

With this PR the following pytest command passes:

pytest sklearn/cluster/tests/test_k_means.py -k sample_weight_deprecation

@lesteve lesteve changed the title CI fix scipy-dev due to deprecation of array elementwise comparison with string CI fix test in scipy-dev build following deprecation of array elementwise comparison with string Jan 6, 2023
@betatim betatim added the Quick Review For PRs that are quick to review label Jan 6, 2023
@betatim
Copy link
Member

betatim commented Jan 6, 2023

I can't take back my approval, but I just spotted the not at the start of the condition, so I need to think for a moment.

@betatim
Copy link
Member

betatim commented Jan 6, 2023

👍 - I had hoped to find a way to write the condition without a not and parentheses, because you got to pay attention to see what is being not'ed and what not. But I can't think of another way.

Copy link
Member

@glemaitre glemaitre left a comment

Choose a reason for hiding this comment

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

LGTM.

Copy link
Member

@jjerphan jjerphan left a comment

Choose a reason for hiding this comment

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

LGTM. Thank you, @lesteve.

@jjerphan jjerphan merged commit f7e5f41 into scikit-learn:main Jan 9, 2023
@lesteve lesteve deleted the numpy-dev-fix branch January 9, 2023 09:10
jjerphan pushed a commit to jjerphan/scikit-learn that referenced this pull request Jan 20, 2023
jjerphan pushed a commit to jjerphan/scikit-learn that referenced this pull request Jan 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build / CI module:cluster Quick Review For PRs that are quick to review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants