Spaces:
Running
Running
File size: 1,305 Bytes
557ee65 | 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 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | # src/tools/interfaces.py
from abc import ABC, abstractmethod
from typing import List, Dict, Any, Optional
from domain.training.charts import ChartSpec
import matplotlib.figure
class IFeatureStore(ABC):
@abstractmethod
def put_features(self, run_id: str, features: Dict[str, Any]):
pass
@abstractmethod
def get_features(self, run_id: str) -> Optional[Dict[str, Any]]:
pass
@abstractmethod
def put_weekly_summary(self, week_key: str, summary: Dict[str, Any]):
pass
@abstractmethod
def get_weekly_summary(self, week_key: str) -> Optional[Dict[str, Any]]:
pass
@abstractmethod
def get_all_features(self) -> List[Dict[str, Any]]:
pass
@abstractmethod
def clear(self):
pass
class IPlanStore(ABC):
@abstractmethod
def save_plan(self, plan_id: str, plan_obj: str):
pass
@abstractmethod
def get_plan(self, plan_id: str) -> Optional[str]:
pass
@abstractmethod
def get_latest_plan(self) -> Optional[str]:
pass
@abstractmethod
def clear(self):
pass
class IVisualizationExecutor(ABC):
@abstractmethod
def render_chart(
self, chart_spec: ChartSpec, features: List[Dict[str, Any]]
) -> matplotlib.figure.Figure:
pass
|