Repository navigation
Closed
Labels
Meta-issueGeneral issue associated to an identified list of tasksgood first issueEasy with clear instructions to resolvehelp wanted
Description
This is a follow-up of #31847 where we switched to absolute imports for Python files thanks to ruff but not Cython files. Maybe one day this can be enforced by cython-lint --ban-relative-imports, see MarcoGorelli/cython-lint#149
Tip
If you want to work on this, please:
- do one Pull Request per file
- add a comment in this issue saying which link you want to tackle so that different people can work on this issue in parallel
- write
Part of #32315in your Pull Request description so that progress on this issue can more easily be tracked
As an example PR you can look at #32316.
Here is the list of Cython files to tackle
- sklearn/cluster/_dbscan_inner.pyx MNT Switch to absolute imports in sklearn/cluster/_dbscan_inner.pyx #32316
- sklearn/cluster/_hdbscan/_linkage.pyx
- sklearn/cluster/_hdbscan/_reachability.pyx
- sklearn/cluster/_hdbscan/_tree.pxd
- sklearn/cluster/_hierarchical_fast.pxd
- sklearn/cluster/_hierarchical_fast.pyx
- sklearn/cluster/_k_means_common.pyx
- sklearn/cluster/_k_means_elkan.pyx
- sklearn/cluster/_k_means_lloyd.pyx
- sklearn/decomposition/_online_lda_fast.pyx
- sklearn/ensemble/_gradient_boosting.pyx @Ganasekhar-gif
- sklearn/ensemble/_hist_gradient_boosting/_binning.pyx
- sklearn/ensemble/_hist_gradient_boosting/_bitset.pxd
- sklearn/ensemble/_hist_gradient_boosting/_bitset.pyx
- sklearn/ensemble/_hist_gradient_boosting/common.pxd
- sklearn/ensemble/_hist_gradient_boosting/_gradient_boosting.pyx
- sklearn/ensemble/_hist_gradient_boosting/histogram.pyx
- sklearn/ensemble/_hist_gradient_boosting/_predictor.pyx
- sklearn/ensemble/_hist_gradient_boosting/splitting.pyx
- sklearn/feature_extraction/_hashing_fast.pyx
- sklearn/linear_model/_cd_fast.pyx
- sklearn/linear_model/_sag_fast.pyx.tp
- sklearn/linear_model/_sgd_fast.pyx.tp
- sklearn/manifold/_barnes_hut_tsne.pyx
- sklearn/manifold/_utils.pyx
- sklearn/metrics/cluster/_expected_mutual_info_fast.pyx
- sklearn/metrics/_dist_metrics.pxd.tp
- sklearn/metrics/_dist_metrics.pyx.tp
- sklearn/metrics/_pairwise_distances_reduction/_argkmin_classmode.pyx.tp
- sklearn/metrics/_pairwise_distances_reduction/_argkmin.pxd.tp
- sklearn/metrics/_pairwise_distances_reduction/_argkmin.pyx.tp
- sklearn/metrics/_pairwise_distances_reduction/_base.pxd.tp
- sklearn/metrics/_pairwise_distances_reduction/_base.pyx.tp
- sklearn/metrics/_pairwise_distances_reduction/_datasets_pair.pxd.tp
- sklearn/metrics/_pairwise_distances_reduction/_datasets_pair.pyx.tp
- sklearn/metrics/_pairwise_distances_reduction/_middle_term_computer.pxd.tp
- sklearn/metrics/_pairwise_distances_reduction/_middle_term_computer.pyx.tp
- sklearn/metrics/_pairwise_distances_reduction/_radius_neighbors_classmode.pyx.tp
- sklearn/metrics/_pairwise_distances_reduction/_radius_neighbors.pxd.tp
- sklearn/metrics/_pairwise_distances_reduction/_radius_neighbors.pyx.tp
- sklearn/metrics/_pairwise_fast.pyx
- sklearn/neighbors/_binary_tree.pxi.tp
- sklearn/neighbors/_partition_nodes.pxd
- sklearn/neighbors/_quad_tree.pxd
- sklearn/neighbors/_quad_tree.pyx
- sklearn/preprocessing/_csr_polynomial_expansion.pyx
- sklearn/preprocessing/_target_encoder_fast.pyx
- sklearn/svm/_liblinear.pyx
- sklearn/svm/_libsvm.pyx
- sklearn/svm/_libsvm_sparse.pyx
- sklearn/tree/_criterion.pxd
- sklearn/tree/_criterion.pyx
- sklearn/tree/_partitioner.pxd
- sklearn/tree/_splitter.pxd
- sklearn/tree/_splitter.pyx
- sklearn/tree/_tree.pxd
- sklearn/tree/_tree.pyx
- sklearn/tree/_utils.pxd
- sklearn/tree/_utils.pyx
- sklearn/utils/arrayfuncs.pyx
- sklearn/utils/_fast_dict.pxd
- sklearn/utils/_fast_dict.pyx MNT Switch to absolute imports in sklearn/utils/_fast_dict.pyx #32317
- sklearn/utils/_heap.pxd
- sklearn/utils/_heap.pyx
- sklearn/utils/murmurhash.pxd
- sklearn/utils/murmurhash.pyx
- sklearn/utils/_random.pxd
- sklearn/utils/_random.pyx
- sklearn/utils/_seq_dataset.pxd.tp
- sklearn/utils/_seq_dataset.pyx.tp
- sklearn/utils/_sorting.pxd
- sklearn/utils/sparsefuncs_fast.pyx
- sklearn/utils/_vector_sentinel.pxd
- sklearn/utils/_weight_vector.pyx.tp
I got the list of files from the following git grep command:
git grep -Pl 'from \..+import|import \.' **/*.pxd **/*.pyx **/*.tp
Reacted by Stefanie Senger, Andrés H. Zapke and Aditya Mehra
Metadata
Metadata
Assignees
Labels
Meta-issueGeneral issue associated to an identified list of tasksgood first issueEasy with clear instructions to resolvehelp wanted
Activity
dipak0000812 commentedon Oct 2, 2025
Hi! I'm working on sklearn/utils/_fast_dict.pyx
Ganasekhar-gif commentedon Oct 2, 2025
can i take this one sklearn/ensemble/_gradient_boosting.pyx
lesteve commentedon Oct 2, 2025
@Ganasekhar-gif @dipak0000812 so this issue is meant for people that attend the PyData sprint today. Will you be at the sprint?
Just curious how did you bump into this issue?
dipak0000812 commentedon Oct 2, 2025
Hi @lesteve!
I apologize for the confusion. I am not physically at the PyData Paris sprint. I found this issue through complete chance while browsing scikit-learn issues looking for beginner-friendly contributions to make my first open source contribution.
I missed the warning at the top that said "Please refrain from working on this issue if you are not physically at the sprint." I'm sorry for jumping in without reading that carefully.
I understand this issue was reserved for sprint participants. Should I close this PR? I'm happy to do so if it's more appropriate for someone at the sprint to work on it.
Again, apologies for the oversight, and thank you for your understanding!
Ganasekhar-gif commentedon Oct 2, 2025
@lesteve Thanks for clarifying! I’m not attending the PyData sprint.
I’ve been actively looking for open issues in Scikit-learn to contribute to, and I came across this one while browsing the repo’s issue tracker.
If this issue is reserved for sprint participants only, I completely understand and I’ll step aside. Otherwise, I’d be happy to work on it.
lesteve commentedon Oct 2, 2025
Thanks for the details @dipak0000812 @Ganasekhar-gif I appreciate it 🙏. Interesting that by pure chance two persons arrive a few hours after I opened the issue but maybe this is to be expected with a reasonably popular repo like scikit-learn 🤷.
I mean now that you are here, feel free to work on the files you mentioned but please don't open another PRs. In a few days we will see how many of the files have been tackled and it will be open for all contributors.
dipak0000812 commentedon Oct 2, 2025
Thank you so much @lesteve for your understanding! I really appreciate the opportunity to contribute.
I'll wait for this PR to be reviewed and won't open any additional PRs until the sprint period is over. Looking forward to contributing more to scikit-learn in the future!
fabarca commentedon Oct 2, 2025
I will work on this file:
sklearn/ensemble/_hist_gradient_boosting/_gradient_boosting.pyxbasilegithub commentedon Oct 2, 2025
I will be working on sklearn/metrics/_pairwise_distances_reduction/_base.pxd.tp
rvraghvender commentedon Oct 2, 2025
I am gonna work on this file "sklearn/utils/sparsefuncs_fast.pyx"
xuzhang0327 commentedon Oct 2, 2025
i will be working on this file "sklearn/linear_model/_cd_fast.pyx"
58 remaining items
Jongwan93 commentedon Oct 8, 2025
Hello I'd like to work on
sklearn/utils/_fast_dict.pxd
Nithurshen commentedon Oct 8, 2025
It has been worked on, I have checked it.
Jongwan93 commentedon Oct 8, 2025
my bad. just ran git grep command.
Working on:
sklearn/metrics/_pairwise_distances_reduction/_datasets_pair.pxd.tp (#32444)
Jongwan93 commentedon Oct 8, 2025
I will also be working on:
sklearn/metrics/_pairwise_distances_reduction/_datasets_pair.pyx.tp
aaron-seq commentedon Oct 8, 2025
Actually, I'd like to work on sklearn/metrics/_pairwise_distances_reduction/_argkmin.pxd.tp instead
aaron-seq commentedon Oct 8, 2025
Hi! I'd like to work on sklearn/metrics/cluster/_expected_mutual_info_fast.pyx
Dex947 commentedon Oct 9, 2025
I'll work on sklearn/metrics/_pairwise_distances_reduction/_base.pxd.tp
Dex947 commentedon Oct 9, 2025
I'll work on sklearn/cluster/_hdbscan/_tree.pxd
Dex947 commentedon Oct 9, 2025
I'll work on sklearn/metrics/cluster/_expected_mutual_info_fast.pyx
Nithurshen commentedon Oct 10, 2025
I'll work on
sklearn/svm/_liblinear.pyxMNT: switch to absolute import in _base.pyx.tp (closes scikit-learn#3…
mahdiabid91 commentedon Oct 10, 2025
working on sklearn/metrics/_pairwise_distances_reduction/_argkmin_classmode.pyx.tp
basilegithub commentedon Oct 10, 2025
Working on " sklearn/metrics/_pairwise_distances_reduction/_argkmin.pxd.tp"
lesteve commentedon Oct 10, 2025
Thanks everyone, it looks like all our Cython code is now using absolute imports!
Quick poll out of curiosity, can you use reactions on this post to explain how you discovered this issue and decided to work on it: