Skip to content

Commit

Permalink
more docstrings added
Browse files Browse the repository at this point in the history
  • Loading branch information
KrissiHub committed Aug 28, 2023
1 parent c0a6a60 commit a36a4bc
Show file tree
Hide file tree
Showing 10 changed files with 406 additions and 2 deletions.
13 changes: 13 additions & 0 deletions deepcave/cli.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# noqa: D400
"""
# CLI
This module defines command-line options using flags.
## Contents
- execute: Entry point for the programms execution.
- main: Call the execute function.
"""

import multiprocessing
import subprocess
from pathlib import Path
Expand All @@ -22,6 +33,7 @@


def execute(_) -> None:
"""Entry point for the programms execution."""
if (config_key := FLAGS.get_config_value) is not None:
config = FLAGS.config
if config is not None:
Expand All @@ -47,4 +59,5 @@ def execute(_) -> None:


def main() -> None:
"""Call the execute function."""
app.run(execute)
64 changes: 64 additions & 0 deletions deepcave/config.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# noqa: D400
"""
# Config
This module defines the config object and its constants.
It also defines multiple constants for directories, the server name and the available plugins.
## Contents
- DEFAULT_WORKING_DIRECTORY: Specifies the default working directory.
- CACHE_DIRECTORY: Specifies the default cache directory.
- SERVER_NAME: Specifies the server name, consisting of address and port.
- PLUGINS: A list of available plugins per category.
- CONVERTERS: A list of available run converters.
"""

from typing import Any, Dict, List, Type

from pathlib import Path
Expand All @@ -7,6 +22,55 @@


class Config:
"""
This class describes the config object.
It also defines the constants of the config object.
Methods
-------
DEFAULT_WORKING_DIRECTORY
Specifies the default working directory.
CACHE_DIRECTORY
Specifies the default cache directory.
SERVER_NAME
Specifies the server name, consisting of address and port.
PLUGINS
A list of available plugins per category.
CONVERTERS
A list of available run converters.
Constants
---------
TITLE : str
"DeepCAVE"
DEBUG: bool
True
REFRESH_RATE: int
500
SAVE_IMAGES
False
FIGURE_MARGIN
dict(t=30, b=0, l=0, r=0)
FIGURE_HEIGHT
"40vh"
REDIS_PORT: int
6379
REDIS_ADDRESS: str
"redis://localhost"
DASH_PORT: int
8050
DASH_ADDRESS: str
"127.0.0.1"
META_DEFAULT: Dict[str, Any]
{
"matplotlib-mode": False,
"working_dir": None, # str(DEFAULT_WORKING_DIRECTORY),
"selected_run_paths": [],
"groups": {}, # {group_name: [run_path, ...]}
}
"""

# General config
TITLE: str = "DeepCAVE"
DEBUG: bool = True
Expand Down
7 changes: 7 additions & 0 deletions deepcave/constants.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# noqa: D400
"""
# Constants
This module defines the constants for the DeepCAVE framework.
"""

NAN_VALUE = -0.2
NAN_LABEL = "NaN"
VALUE_RANGE = [NAN_VALUE, 1]
Expand Down
1 change: 1 addition & 0 deletions deepcave/evaluators/footprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
class Footprint:
"""
This class can train and create a footptint of a model.
It uses an MDS plot.
Methods
Expand Down
11 changes: 11 additions & 0 deletions deepcave/layouts/general.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
"""
# GeneralLayout
This module provides the General Layout class.
It handles different callbacks of the layout.
## Contents
- callback:
- get_converter_text: Get the text for the available run converters.
"""

from typing import Dict, List, Optional, Type

from pathlib import Path
Expand Down
Loading

0 comments on commit a36a4bc

Please sign in to comment.