Skip to content

Update _hierarchical_fast.pyx #29368

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jayant1554
Copy link

Fix bug in mst_linkage_core function initialization

  • Corrected initialization of new_node to handle edge cases.
  • Added validation to ensure the algorithm continues properly when no new node is found.

Closes #1234

Reference Issues/PRs

What does this implement/fix? Explain your changes.

Any other comments?

Fix bug in mst_linkage_core function initialization

- Corrected initialization of new_node to handle edge cases.
- Added validation to ensure the algorithm continues properly when no new node is found.

Closes scikit-learn#1234
Copy link

github-actions bot commented Jun 28, 2024

❌ Linting issues

This PR is introducing linting issues. Here's a summary of the issues. Note that you can avoid having linting issues by enabling pre-commit hooks. Instructions to enable them can be found here.

You can see the details of the linting issues under the lint job here


cython-lint

cython-lint detected issues. Please fix them locally and push the changes. Here you can see the detected issues. Note that the installed cython-lint version is cython-lint=0.16.2.


Skipping file /home/runner/work/scikit-learn/scikit-learn/sklearn/cluster/_hierarchical_fast.pyx, as it cannot be parsed. Error: AttributeError("'_thread._local' object has no attribute 'cython_errors_stack'")
/home/runner/work/scikit-learn/scikit-learn/sklearn/cluster/_hierarchical_fast.pyx:434:1: E302 expected 2 blank lines, found 1
/home/runner/work/scikit-learn/scikit-learn/sklearn/cluster/_hierarchical_fast.pyx:480:52: E128 continuation line under-indented for visual indent
/home/runner/work/scikit-learn/scikit-learn/sklearn/cluster/_hierarchical_fast.pyx:481:52: E128 continuation line under-indented for visual indent
/home/runner/work/scikit-learn/scikit-learn/sklearn/cluster/_hierarchical_fast.pyx:498:1: W391 blank line at end of file

Generated for commit: a858792. Link to the linter CI: here

@jayant1554 jayant1554 closed this Jun 28, 2024
@jayant1554 jayant1554 deleted the patch-1 branch June 28, 2024 22:40
Copy link
Author

@jayant1554 jayant1554 left a comment

Choose a reason for hiding this comment

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

Fix bug in mst_linkage_core function initialization

  • Corrected initialization of new_node to handle edge cases.
  • Added validation to ensure the algorithm continues properly when no new node is found.

Closes #1234

@jayant1554 jayant1554 restored the patch-1 branch June 28, 2024 22:43
@jayant1554 jayant1554 reopened this Jun 28, 2024
Copy link
Author

@jayant1554 jayant1554 left a comment

Choose a reason for hiding this comment

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

done

Copy link
Author

@jayant1554 jayant1554 left a comment

Choose a reason for hiding this comment

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

reviewd

@adrinjalali
Copy link
Member

This would need a test to show what it's fixing. And needs to pass the linter as well.

@jayant1554
Copy link
Author

jayant1554 commented Jul 4, 2024

This would need a test to show what it's fixing. And needs to pass the linter as well.

i will fix the linter issue could you please tell me what test case I can you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants