Skip to content

Commit 94d1163

Browse files
sync with pr-1576
1 parent f70aa54 commit 94d1163

File tree

5 files changed

+14
-8
lines changed

5 files changed

+14
-8
lines changed

openml/_api/resources/base/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
from openml._api.resources.base.base import APIVersion, ResourceAPI, ResourceType
22
from openml._api.resources.base.fallback import FallbackProxy
3-
from openml._api.resources.base.resources import DatasetsAPI, TasksAPI
3+
from openml._api.resources.base.resources import DatasetsAPI, EstimationProceduresAPI, TasksAPI
44
from openml._api.resources.base.versions import ResourceV1, ResourceV2
55

66
__all__ = [
77
"APIVersion",
88
"DatasetsAPI",
9+
"EstimationProceduresAPI",
910
"FallbackProxy",
1011
"ResourceAPI",
1112
"ResourceType",

openml/_api/resources/base/resources.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import annotations
22

33
import builtins
4-
from abc import ABC, abstractmethod
4+
from abc import abstractmethod
55
from typing import TYPE_CHECKING, Any
66

77
from openml._api.resources.base import ResourceAPI, ResourceType
@@ -32,7 +32,7 @@ def get(
3232
) -> OpenMLTask | tuple[OpenMLTask, Response]: ...
3333

3434

35-
class EstimationProceduresAPI(ResourceAPI, ABC):
35+
class EstimationProceduresAPI(ResourceAPI):
3636
@abstractmethod
3737
def list(self) -> list[str]: ...
3838

openml/_api/resources/estimation_procedures.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66

77
import xmltodict
88

9-
from openml._api.resources.base import EstimationProceduresAPI
9+
from openml._api.resources.base import EstimationProceduresAPI, ResourceV1, ResourceV2
1010
from openml.tasks.task import TaskType
1111

1212

13-
class EstimationProceduresV1(EstimationProceduresAPI):
13+
class EstimationProceduresV1(ResourceV1, EstimationProceduresAPI):
1414
"""V1 API implementation for estimation procedures.
1515
1616
Fetches estimation procedures from the v1 XML API endpoint.
@@ -105,7 +105,7 @@ def _get_details(self) -> builtins.list[dict[str, Any]]:
105105
return procs
106106

107107

108-
class EstimationProceduresV2(EstimationProceduresAPI):
108+
class EstimationProceduresV2(ResourceV2, EstimationProceduresAPI):
109109
"""V2 API implementation for estimation procedures.
110110
111111
Fetches estimation procedures from the v2 JSON API endpoint.

openml/_api/runtime/core.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
from openml._api.resources import (
99
DatasetsV1,
1010
DatasetsV2,
11-
FallbackProxy,
1211
EstimationProceduresV1,
1312
EstimationProceduresV2,
13+
FallbackProxy,
1414
TasksV1,
1515
TasksV2,
1616
)
@@ -77,6 +77,9 @@ def build_backend(version: str, *, strict: bool) -> APIBackend:
7777
return APIBackend(
7878
datasets=FallbackProxy(DatasetsV2(v2_http_client), DatasetsV1(v1_http_client)),
7979
tasks=FallbackProxy(TasksV2(v2_http_client), TasksV1(v1_http_client)),
80+
estimation_procedures=FallbackProxy(
81+
EstimationProceduresV2(v2_http_client), EstimationProceduresV1(v1_http_client)
82+
),
8083
)
8184

8285

openml/tasks/functions.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
import openml._api_calls
1414
import openml.utils
15+
from openml._api import api_context
1516
from openml.datasets import get_dataset
1617
from openml.exceptions import OpenMLCacheException
1718

@@ -80,7 +81,8 @@ def _get_estimation_procedure_list() -> list[dict[str, Any]]:
8081
a dictionary containing the following information: id, task type id,
8182
name, type, repeats, folds, stratified.
8283
"""
83-
return api_context.backend.estimation_procedures._get_details()
84+
result: list[dict[str, Any]] = api_context.backend.estimation_procedures._get_details()
85+
return result
8486

8587

8688
def list_tasks( # noqa: PLR0913

0 commit comments

Comments
 (0)