1+ # noqa: D400
2+ """
3+ # Config
4+
5+ This module defines the config object and its constants.
6+ Also defines multiple constants for directories, the server name, available plugins and converters.
7+
8+ ## Classes
9+ - Config: Describe the config object.
10+ """
11+
112from typing import Any , Dict , List , Type
213
314from pathlib import Path
415
16+ from deepcave .runs .run import Run
17+
518
619class Config :
20+ """
21+ Describe the config object.
22+
23+ Also define the constants of the config object.
24+ Includes multiple constants for directories, the server name, available plugins and converters.
25+
26+ Constants
27+ ---------
28+ TITLE : str
29+ DEBUG: bool
30+ REFRESH_RATE: int
31+ SAVE_IMAGES: bool
32+ FIGURE_MARGIN: Dict
33+ FIGURE_HEIGHT: str
34+ REDIS_PORT: int
35+ REDIS_ADDRESS: str
36+ DASH_PORT: int
37+ DASH_ADDRESS: str
38+ META_DEFAULT: Dict
39+
40+ Properties
41+ ----------
42+ DASH_ADRESS : str
43+ The address of the server name.
44+ DASH_PORT : int
45+ The port of the server name.
46+ """
47+
748 # General config
849 TITLE : str = "DeepCAVE"
950 DEBUG : bool = False
@@ -34,18 +75,22 @@ class Config:
3475
3576 @property
3677 def DEFAULT_WORKING_DIRECTORY (self ) -> Path :
78+ """Specifies the default working directory."""
3779 return Path .cwd () / "logs"
3880
3981 @property
4082 def CACHE_DIR (self ) -> Path :
83+ """Specifies the default cache directory."""
4184 return Path (__file__ ).parent / "cache"
4285
4386 @property
4487 def SERVER_NAME (self ) -> str :
88+ """Specifies the server name, consisting of address and port."""
4589 return f"http://{ self .DASH_ADDRESS } :{ self .DASH_PORT } "
4690
4791 @property
48- def PLUGINS (self ) -> Dict [str , List ["Plugin" ]]:
92+ def PLUGINS (self ) -> Dict [str , List [Any ]]:
93+ """A list of available plugins per category."""
4994 from deepcave .plugins .budget .budget_correlation import BudgetCorrelation
5095 from deepcave .plugins .hyperparameter .importances import Importances
5196 from deepcave .plugins .hyperparameter .pdp import PartialDependencies
@@ -60,6 +105,7 @@ def PLUGINS(self) -> Dict[str, List["Plugin"]]:
60105 from deepcave .plugins .summary .footprint import FootPrint
61106 from deepcave .plugins .summary .overview import Overview
62107
108+ plugins : Dict [str , List [Any ]] = {}
63109 plugins = {
64110 "Summary" : [
65111 Overview (),
@@ -85,6 +131,7 @@ def PLUGINS(self) -> Dict[str, List["Plugin"]]:
85131
86132 @property
87133 def CONVERTERS (self ) -> List [Type ["Run" ]]:
134+ """Get a list of available run converters."""
88135 from deepcave .runs .converters .bohb import BOHBRun
89136 from deepcave .runs .converters .deepcave import DeepCAVERun
90137 from deepcave .runs .converters .smac3v1 import SMAC3v1Run
0 commit comments