Skip to content

Commit 2d1a8d8

Browse files
Merge branch 'main' into doc/update-local-services-testing-docs
2 parents 91bb257 + e653ef6 commit 2d1a8d8

69 files changed

Lines changed: 4627 additions & 1347 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/test.yml

Lines changed: 39 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,27 @@ jobs:
3434
sklearn-only: ["true"]
3535

3636
exclude:
37-
# incompatible version combinations
37+
# (python, sklearn) combinations for which there is no PyPI release
38+
# scikit-learn 1.3
3839
- python-version: "3.13"
3940
scikit-learn: "1.3.*"
40-
- python-version: "3.13"
41-
scikit-learn: "1.4.*"
4241
- python-version: "3.14"
4342
scikit-learn: "1.3.*"
43+
# scikit-learn 1.4
44+
- python-version: "3.13"
45+
scikit-learn: "1.4.*"
4446
- python-version: "3.14"
4547
scikit-learn: "1.4.*"
48+
# scikit-learn 1.5
49+
- python-version: "3.14"
50+
scikit-learn: "1.5.*"
51+
# scikit-learn 1.6
52+
- python-version: "3.14"
53+
scikit-learn: "1.6.*"
54+
# scikit-learn 1.7 is installed with pandas 3
55+
- python-version: "3.10"
56+
scikit-learn: "1.7.*"
57+
4658

4759
include:
4860
# Full test run on ubuntu, 3.14
@@ -64,14 +76,6 @@ jobs:
6476
sklearn-only: "false"
6577
code-cov: true
6678

67-
# Pandas 2 run
68-
- os: ubuntu-latest
69-
python-version: "3.12"
70-
scikit-learn: "1.5.*"
71-
sklearn-only: "false"
72-
pandas-version: "2.*"
73-
code-cov: false
74-
7579
steps:
7680
- uses: actions/checkout@v6
7781
with:
@@ -82,15 +86,21 @@ jobs:
8286
with:
8387
python-version: ${{ matrix.python-version }}
8488

85-
- name: Install test dependencies, scikit-learn, and optional pandas
89+
- name: Install test dependencies, scikit-learn, and pandas
8690
shell: bash
8791
run: |
8892
python -m pip install --upgrade pip
8993
pip install -e .[test] scikit-learn==${{ matrix.scikit-learn }}
90-
91-
if [ "${{ matrix.pandas-version }}" != "" ]; then
92-
echo "Installing specific pandas version: ${{ matrix.pandas-version }}"
93-
pip install "pandas==${{ matrix.pandas-version }}"
94+
95+
# scikit-learn 1.7+ requires pandas 3.x, earlier versions use pandas 2.x
96+
version="${{ matrix.scikit-learn }}"
97+
major=$(echo "$version" | cut -d. -f1)
98+
minor=$(echo "$version" | cut -d. -f2)
99+
100+
if [[ "$major" -gt 1 ]] || { [[ "$major" -eq 1 ]] && [[ "$minor" -ge 7 ]]; }; then
101+
pip install "pandas==3.*"
102+
else
103+
pip install "pandas==2.*"
94104
fi
95105
96106
- name: Store repository status
@@ -103,21 +113,27 @@ jobs:
103113
104114
- name: Clone Services
105115
if: matrix.os == 'ubuntu-latest'
116+
id: clone-services
106117
run: |
107118
git clone --depth 1 https://github.com/openml/services.git
108119
109120
- name: Start Docker Services
121+
id: start-services
110122
if: matrix.os == 'ubuntu-latest'
111123
working-directory: ./services
112124
run: |
113-
docker compose --profile rest-api --profile minio up -d
125+
chmod -R a+rw ./data
126+
chmod -R a+rw ./logs
127+
docker compose --profile rest-api --profile minio --profile evaluation-engine up -d
114128
115129
echo "Waiting for PHP API to boot..."
116130
timeout 60s bash -c 'until [ "$(docker inspect -f {{.State.Health.Status}} openml-php-rest-api)" == "healthy" ]; do sleep 5; done'
117131
118132
echo "Final Verification: Gateway Connectivity..."
119133
curl -sSfL http://localhost:8000/api/v1/xml/data/1 | head -n 15
120134
135+
docker container ls
136+
121137
- name: Show installed dependencies
122138
run: python -m pip list
123139

@@ -173,8 +189,13 @@ jobs:
173189
fail_ci_if_error: true
174190
verbose: true
175191

192+
- name: Dump server logs
193+
if: always() && steps.start-services.outcome == 'success'
194+
run: |
195+
docker logs openml-php-rest-api -t
196+
176197
- name: Cleanup Docker setup
177-
if: matrix.os == 'ubuntu-latest' && always()
198+
if: always() && steps.clone-services.outcome == 'success'
178199
run: |
179200
sudo rm -rf services
180201

openml/__init__.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@
1818
# License: BSD 3-Clause
1919
from __future__ import annotations
2020

21+
from typing import TYPE_CHECKING
22+
2123
from . import (
2224
_api_calls,
23-
config,
25+
_config as _config_module,
2426
datasets,
2527
evaluations,
2628
exceptions,
@@ -33,6 +35,7 @@
3335
utils,
3436
)
3537
from .__version__ import __version__
38+
from ._api import _backend
3639
from .datasets import OpenMLDataFeature, OpenMLDataset
3740
from .evaluations import OpenMLEvaluation
3841
from .flows import OpenMLFlow
@@ -49,6 +52,11 @@
4952
OpenMLTask,
5053
)
5154

55+
if TYPE_CHECKING:
56+
from ._config import OpenMLConfigManager
57+
58+
config: OpenMLConfigManager = _config_module.__config
59+
5260

5361
def populate_cache(
5462
task_ids: list[int] | None = None,
@@ -109,6 +117,7 @@ def populate_cache(
109117
"OpenMLTask",
110118
"__version__",
111119
"_api_calls",
120+
"_backend",
112121
"config",
113122
"datasets",
114123
"evaluations",

openml/_api/__init__.py

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
from .clients import (
2+
HTTPCache,
3+
HTTPClient,
4+
MinIOClient,
5+
)
6+
from .resources import (
7+
API_REGISTRY,
8+
DatasetAPI,
9+
DatasetV1API,
10+
DatasetV2API,
11+
EstimationProcedureAPI,
12+
EstimationProcedureV1API,
13+
EstimationProcedureV2API,
14+
EvaluationAPI,
15+
EvaluationMeasureAPI,
16+
EvaluationMeasureV1API,
17+
EvaluationMeasureV2API,
18+
EvaluationV1API,
19+
EvaluationV2API,
20+
FallbackProxy,
21+
FlowAPI,
22+
FlowV1API,
23+
FlowV2API,
24+
ResourceAPI,
25+
ResourceV1API,
26+
ResourceV2API,
27+
RunAPI,
28+
RunV1API,
29+
RunV2API,
30+
SetupAPI,
31+
SetupV1API,
32+
SetupV2API,
33+
StudyAPI,
34+
StudyV1API,
35+
StudyV2API,
36+
TaskAPI,
37+
TaskV1API,
38+
TaskV2API,
39+
)
40+
from .setup import (
41+
APIBackend,
42+
APIBackendBuilder,
43+
_backend,
44+
)
45+
46+
__all__ = [
47+
"API_REGISTRY",
48+
"APIBackend",
49+
"APIBackendBuilder",
50+
"DatasetAPI",
51+
"DatasetV1API",
52+
"DatasetV2API",
53+
"EstimationProcedureAPI",
54+
"EstimationProcedureV1API",
55+
"EstimationProcedureV2API",
56+
"EvaluationAPI",
57+
"EvaluationMeasureAPI",
58+
"EvaluationMeasureV1API",
59+
"EvaluationMeasureV2API",
60+
"EvaluationV1API",
61+
"EvaluationV2API",
62+
"FallbackProxy",
63+
"FlowAPI",
64+
"FlowV1API",
65+
"FlowV2API",
66+
"HTTPCache",
67+
"HTTPClient",
68+
"MinIOClient",
69+
"ResourceAPI",
70+
"ResourceV1API",
71+
"ResourceV2API",
72+
"RunAPI",
73+
"RunV1API",
74+
"RunV2API",
75+
"SetupAPI",
76+
"SetupV1API",
77+
"SetupV2API",
78+
"StudyAPI",
79+
"StudyV1API",
80+
"StudyV2API",
81+
"TaskAPI",
82+
"TaskV1API",
83+
"TaskV2API",
84+
"_backend",
85+
]

openml/_api/clients/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
from .http import HTTPCache, HTTPClient
2+
from .minio import MinIOClient
3+
4+
__all__ = [
5+
"HTTPCache",
6+
"HTTPClient",
7+
"MinIOClient",
8+
]

0 commit comments

Comments
 (0)