|
| 1 | +from __future__ import annotations |
| 2 | + |
| 3 | +from typing import TYPE_CHECKING |
| 4 | + |
| 5 | +from openml.enums import APIVersion, ResourceType |
| 6 | + |
| 7 | +from .dataset import DatasetV1API, DatasetV2API |
| 8 | +from .estimation_procedure import ( |
| 9 | + EstimationProcedureV1API, |
| 10 | + EstimationProcedureV2API, |
| 11 | +) |
| 12 | +from .evaluation import EvaluationV1API, EvaluationV2API |
| 13 | +from .evaluation_measure import EvaluationMeasureV1API, EvaluationMeasureV2API |
| 14 | +from .flow import FlowV1API, FlowV2API |
| 15 | +from .run import RunV1API, RunV2API |
| 16 | +from .setup import SetupV1API, SetupV2API |
| 17 | +from .study import StudyV1API, StudyV2API |
| 18 | +from .task import TaskV1API, TaskV2API |
| 19 | + |
| 20 | +if TYPE_CHECKING: |
| 21 | + from .base import ResourceAPI |
| 22 | + |
| 23 | +API_REGISTRY: dict[ |
| 24 | + APIVersion, |
| 25 | + dict[ResourceType, type[ResourceAPI]], |
| 26 | +] = { |
| 27 | + APIVersion.V1: { |
| 28 | + ResourceType.DATASET: DatasetV1API, |
| 29 | + ResourceType.TASK: TaskV1API, |
| 30 | + ResourceType.EVALUATION_MEASURE: EvaluationMeasureV1API, |
| 31 | + ResourceType.ESTIMATION_PROCEDURE: EstimationProcedureV1API, |
| 32 | + ResourceType.EVALUATION: EvaluationV1API, |
| 33 | + ResourceType.FLOW: FlowV1API, |
| 34 | + ResourceType.STUDY: StudyV1API, |
| 35 | + ResourceType.RUN: RunV1API, |
| 36 | + ResourceType.SETUP: SetupV1API, |
| 37 | + }, |
| 38 | + APIVersion.V2: { |
| 39 | + ResourceType.DATASET: DatasetV2API, |
| 40 | + ResourceType.TASK: TaskV2API, |
| 41 | + ResourceType.EVALUATION_MEASURE: EvaluationMeasureV2API, |
| 42 | + ResourceType.ESTIMATION_PROCEDURE: EstimationProcedureV2API, |
| 43 | + ResourceType.EVALUATION: EvaluationV2API, |
| 44 | + ResourceType.FLOW: FlowV2API, |
| 45 | + ResourceType.STUDY: StudyV2API, |
| 46 | + ResourceType.RUN: RunV2API, |
| 47 | + ResourceType.SETUP: SetupV2API, |
| 48 | + }, |
| 49 | +} |
0 commit comments