Skip to content

Commit 8186586

Browse files
committed
Add patch for scikit-learn 1.5.2
1 parent 2c0f60c commit 8186586

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

graalpython/lib-graalpython/patches/metadata.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -565,6 +565,12 @@ version = '== 0.3.3'
565565
patch = 'safetensors-0.3.3.patch'
566566
license = 'Apache-2.0'
567567

568+
[[scikit-learn.rules]]
569+
version = '== 1.5.2'
570+
patch = 'scikit-learn-1.5.2.patch'
571+
license = 'BSD-3-Clause'
572+
dist-type = 'sdist'
573+
568574
[[scikit-learn.rules]]
569575
version = '== 1.2.2'
570576
patch = 'scikit-learn-1.2.2.patch'
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
diff --git a/sklearn/_build_utils/__init__.py b/sklearn/_build_utils/__init__.py
2+
index ceb7244..0a0acc2 100644
3+
--- a/sklearn/_build_utils/__init__.py
4+
+++ b/sklearn/_build_utils/__init__.py
5+
@@ -59,10 +59,10 @@ def cythonize_extensions(extension):
6+
sklearn._OPENMP_SUPPORTED = check_openmp_support()
7+
8+
n_jobs = 1
9+
- with contextlib.suppress(ImportError):
10+
- import joblib
11+
+ # with contextlib.suppress(ImportError):
12+
+ # import joblib
13+
14+
- n_jobs = joblib.cpu_count()
15+
+ # n_jobs = joblib.cpu_count()
16+
17+
# Additional checks for Cython
18+
cython_enable_debug_directives = (
19+
diff --git a/sklearn/datasets/_svmlight_format_fast.pyx b/sklearn/datasets/_svmlight_format_fast.pyx
20+
index 103d43b..e2cc6da 100644
21+
--- a/sklearn/datasets/_svmlight_format_fast.pyx
22+
+++ b/sklearn/datasets/_svmlight_format_fast.pyx
23+
@@ -80,7 +80,7 @@ def _load_svmlight_file(f, dtype, bint multilabel, bint zero_based,
24+
if n_features and features[0].startswith(qid_prefix):
25+
_, value = features[0].split(COLON, 1)
26+
if query_id:
27+
- query.resize(len(query) + 1)
28+
+ query.resize(len(query) + 1, refcheck=False)
29+
query[len(query) - 1] = np.int64(value)
30+
features.pop(0)
31+
n_features -= 1

0 commit comments

Comments
 (0)