Skip to content

Conversation

@thomasjpfan
Copy link
Member

Reference Issues/PRs

Fixes #21685

What does this implement/fix? Explain your changes.

This PR forces the memoryview attributes to be constant. node_data is created to be writable ndarray in __init__ and is populated when _recursive_build is called. _recursive_build is only called in __init__. Afterwards __init__, node_data not no longer modified.

CC @jjerphan

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 after treating suggestions.

Thank you for working on this, @thomasjpfan; I am currently busy with other tasks.

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. I confirm the non-regression test would fail in main and now passes with this PR.

@ogrisel
Copy link
Member

ogrisel commented Dec 1, 2021

I pushed 9b173be to fix the linter and get a full CI run.

@thomasjpfan thomasjpfan added this to the 1.0.2 milestone Dec 1, 2021
@ogrisel ogrisel merged commit f9b98c8 into scikit-learn:main Dec 2, 2021
glemaitre pushed a commit to glemaitre/scikit-learn that referenced this pull request Dec 24, 2021
glemaitre pushed a commit that referenced this pull request Dec 25, 2021
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.

ValueError: buffer source array is read-only in sklearn.neighbors._dist_metrics.DistanceMetric.__setstate__ with ray

3 participants