forked from openml/openml-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_connector.py
More file actions
28 lines (19 loc) · 751 Bytes
/
_connector.py
File metadata and controls
28 lines (19 loc) · 751 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# License: BSD 3-Clause
"""Base class for OpenML API connectors."""
from __future__ import annotations
from abc import ABC, abstractmethod
from typing import TYPE_CHECKING, Any
if TYPE_CHECKING:
from openml.extensions.base import ModelExecutor, ModelSerializer
class OpenMLAPIConnector(ABC):
"""Base class for OpenML API connectors."""
@abstractmethod
def serializer(self) -> ModelSerializer:
"""Return the serializer for this API."""
@abstractmethod
def executor(self) -> ModelExecutor:
"""Return the executor for this API."""
@classmethod
@abstractmethod
def supports(cls, estimator: Any) -> bool:
"""High-level check if this connector supports the estimator instance or flow."""