Skip to content

MAINT Use push_back directly in dbscan_inner #22077

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
Dec 31, 2021

Conversation

thomasjpfan
Copy link
Member

This PR removes helper code and calls push_back directly. Looking at the push_back import in Cython:

https://github.com/cython/cython/blob/bba69054b4aff2c0a63a8be9d6ce5c9fdd079a52/Cython/Includes/libcpp/vector.pxd#L74

the C++ exception is already converted into a Python exception when push_back is called.

CC @jjerphan

CC @glemaitre I think this is causing the complier issue in conda-forge windows pypy3

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.

Indeed, when this adaptation has been introduced (27d4376) scikit-learn was probably not using the latest version of Cython which introduced the exception handling for some containers from libcpp (cython/cython@b44bdbb).

LGTM!

Copy link
Member

@ogrisel ogrisel left a comment

Choose a reason for hiding this comment

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

LGTM as well.

@ogrisel ogrisel merged commit c010d9a into scikit-learn:main Dec 31, 2021
venkyyuvy pushed a commit to venkyyuvy/scikit-learn that referenced this pull request Jan 1, 2022
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.

3 participants