Skip to content

Commit

Permalink
reformatted docstrings for pydocstyle again
Browse files Browse the repository at this point in the history
  • Loading branch information
KrissiHub committed Feb 8, 2024
1 parent 021a111 commit b40b6da
Show file tree
Hide file tree
Showing 28 changed files with 160 additions and 127 deletions.
8 changes: 4 additions & 4 deletions deepcave/custom_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def get_worker(self, worker_name: str) -> Worker:
def get_workers(self) -> List[Worker]:
"""
Get the workers in the queue.
Returns
-------
List[Worker]
Expand Down Expand Up @@ -254,7 +254,7 @@ def get_jobs(self, registry: str = "running") -> List[Job]:
def get_running_jobs(self) -> List[Job]:
"""
Get the running jobs in the registry.
Returns
-------
List[Job]
Expand All @@ -265,7 +265,7 @@ def get_running_jobs(self) -> List[Job]:
def get_pending_jobs(self) -> List[Job]:
"""
Get the pending jobs in the registry.
Returns
-------
List[Job]
Expand All @@ -276,7 +276,7 @@ def get_pending_jobs(self) -> List[Job]:
def get_finished_jobs(self) -> List[Job]:
"""
Get the finished jobs in the registry.
Returns
-------
List[Job]
Expand Down
2 changes: 1 addition & 1 deletion deepcave/evaluators/epm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
random_forest_surrogate
This module provides a RandomForest Surrogate model.
utils
This module provides a utility to get the types
This module provides a utility to get the types
as well as the bounds of the Hyperparameters.
"""
2 changes: 1 addition & 1 deletion deepcave/evaluators/epm/fanova_forest.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def compute_marginals(
Parameters
----------
hp_ids: Union[List[int], Tuple[int, ...]]
Contains the indices of the configspace for the selected Hyperparameters
Contains the indices of the configspace for the selected Hyperparameters
(starts with 0).
depth: int
The depth of the marginalization.
Expand Down
2 changes: 1 addition & 1 deletion deepcave/evaluators/epm/random_forest.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ def _predict(self, X: np.ndarray) -> Tuple[np.ndarray, np.ndarray]:
Parameters
----------
X : np.ndarray
X : np.ndarray
[n_samples, n_features (config + instance features)]
Returns
Expand Down
2 changes: 1 addition & 1 deletion deepcave/evaluators/epm/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""
# Utils
This module provides a utility to get the types
This module provides a utility to get the types
as well as the bounds of the Hyperparameters.
"""

Expand Down
20 changes: 11 additions & 9 deletions deepcave/plugins/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,7 @@ def _clean_inputs(self, inputs: Dict[str, Any]) -> Dict[str, Any]:
def runs(self) -> List[AbstractRun]:
"""
Get the runs as a list.
Returns
-------
List[AbstractRun]
Expand All @@ -811,7 +811,7 @@ def runs(self) -> List[AbstractRun]:
def groups(self) -> List[Group]:
"""
Get the groups as a list.
Returns
-------
List[Group]
Expand All @@ -826,7 +826,7 @@ def groups(self) -> List[Group]:
def all_runs(self) -> List[AbstractRun]:
"""
Get all runs and include the groups as a list.
Returns
-------
List[AbstractRun]
Expand Down Expand Up @@ -963,18 +963,19 @@ def register_in(a: str, b: Union[List[str], str]) -> str:
Note
----
For more information, see 'register_input'.
Parameters
----------
a : str
Specifies the id of the input.
b : Union[List[str], str]
Attributes which should be passed to the (dash) component, by default ("value",).
Returns
-------
str
Unique id for the input and plugin. This is necessary because ids are defined globally.
Unique id for the input and plugin.
This is necessary because ids are defined globally.
"""
return self.register_input(a, b, filter=True)

Expand Down Expand Up @@ -1002,7 +1003,7 @@ def register_in(a: str, b: Union[List[str], str]) -> str:
def register_out(a: str, b: Union[List[str], str]) -> str:
"""
Register the output.
Note
----
For more information, see 'register_output'
Expand All @@ -1013,11 +1014,12 @@ def register_out(a: str, b: Union[List[str], str]) -> str:
Specifies the id of the output.
b : Union[List[str], str]
Attribute.
Returns
-------
str
Unique id for the output and plugin. This is necessary because ids are defined globally.
Unique id for the output and plugin.
This is necessary because ids are defined globally.
"""
return self.register_output(a, b, mpl=True)

Expand Down
8 changes: 4 additions & 4 deletions deepcave/plugins/budget/budget_correlation.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def get_input_layout(register: Callable) -> List[html.Div]:
# Types dont match superclass
def load_dependency_inputs(self, run, _, inputs) -> Dict[str, Dict[str, Any]]:
"""
Same as 'load_inputs' but called after inputs have changed.
Work like 'load_inputs' but called after inputs have changed.
Note
----
Expand Down Expand Up @@ -139,7 +139,7 @@ def process(run: AbstractRun, inputs: Dict[str, int]) -> Dict[str, Any]:
Note
----
The passed inputs are cleaned and therefore differ
The passed inputs are cleaned and therefore differ
compared to 'load_inputs' or 'load_dependency_inputs'.
Please see '_clean_inputs' for more information.
Expand All @@ -153,7 +153,7 @@ def process(run: AbstractRun, inputs: Dict[str, int]) -> Dict[str, Any]:
Returns
-------
Dict[str, Any]
Serialized dictionary with the correlations
Serialized dictionary with the correlations
as well as the correlations symmetric.
"""
objective_id = inputs["objective_id"]
Expand Down Expand Up @@ -238,7 +238,7 @@ def load_outputs(run, _, outputs) -> List[Any]:
Note
----
The passed inputs are cleaned and therefore differ
The passed inputs are cleaned and therefore differ
compared to 'load_inputs' or 'load_dependency_inputs'.
Please see '_clean_inputs' for more information.
Expand Down
14 changes: 8 additions & 6 deletions deepcave/plugins/dynamic.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,12 @@ def __init__(self) -> None:
@interactive
def register_callbacks(self) -> None:
"""
Register basic callbacks for the plugin.
Following callbacks are registered:
- If inputs changes, the changes are pasted back. This is in particular interest if input dependencies are used.
- Raw data dialog to display raw data.
Register basic callbacks for the plugin.
Following callbacks are registered:
- If inputs changes, the changes are pasted back.
This is in particular interest if input dependencies are used.
- Raw data dialog to display raw data.
- Callback to be redirected to the config if clicked on it.
"""
super().register_callbacks()
Expand Down Expand Up @@ -119,8 +121,8 @@ def plugin_output_update(_: Any, *inputs_list: str) -> Any:
# Return type does not match the superclass
def __call__(self) -> List[Component]:
"""
Return the components for the plugin.
Return the components for the plugin.
Basically, all blocks and elements of the plugin are stacked-up here.
Returns
Expand Down
13 changes: 7 additions & 6 deletions deepcave/plugins/hyperparameter/importances.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,9 @@ def get_filter_layout(register: Callable) -> List[html.Div]:

def load_inputs(self) -> Dict[str, Dict[str, Any]]:
"""
Load the content for the defined inputs in 'get_input_layout'
and 'get_filter_layout'. This method is necessary to pre-load contents for the inputs.
Load the content for the defined inputs in 'get_input_layout' and 'get_filter_layout'.
This method is necessary to pre-load contents for the inputs.
If the plugin is called for the first time, or there are no results in the cache,
the plugin gets its content from this method.
Expand All @@ -181,7 +182,7 @@ def load_inputs(self) -> Dict[str, Dict[str, Any]]:
# Types dont match superclass
def load_dependency_inputs(self, run, _: Any, inputs: Dict[str, Any]) -> Dict[str, Any]:
"""
Same as 'load_inputs' but called after inputs have changed.
Work like 'load_inputs' but called after inputs have changed.
Note
----
Expand Down Expand Up @@ -264,7 +265,7 @@ def process(run: AbstractRun, inputs: Dict[str, Any]) -> Dict[str, Any]:
Note
----
The passed inputs are cleaned and therefore differ
The passed inputs are cleaned and therefore differ
compared to 'load_inputs' or 'load_dependency_inputs'.
Please see '_clean_inputs' for more information.
Expand Down Expand Up @@ -342,7 +343,7 @@ def load_outputs(run, inputs, outputs) -> go.Figure:
Note
----
The passed inputs are cleaned and therefore differ
The passed inputs are cleaned and therefore differ
compared to 'load_inputs' or 'load_dependency_inputs'.
Please see '_clean_inputs' for more information.
Expand Down Expand Up @@ -461,7 +462,7 @@ def get_mpl_output_layout(register: Callable) -> html.Img:
def load_mpl_outputs(run, inputs: Dict[str, Any], outputs):
"""
Read the raw data and prepare it for the layout.
Parameters
----------
run
Expand Down
11 changes: 6 additions & 5 deletions deepcave/plugins/hyperparameter/pdp.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,9 @@ def get_filter_layout(register: Callable) -> List[Any]:

def load_inputs(self) -> Dict[str, Dict[str, Any]]:
"""
Load the content for the defined inputs in 'get_input_layout'
and 'get_filter_layout'. This method is necessary to pre-load contents for the inputs.
Load the content for the defined inputs in 'get_input_layout' and 'get_filter_layout'.
This method is necessary to pre-load contents for the inputs.
If the plugin is called for the first time, or there are no results in the cache,
the plugin gets its content from this method.
Expand All @@ -200,7 +201,7 @@ def load_inputs(self) -> Dict[str, Dict[str, Any]]:
# Types dont match superclass
def load_dependency_inputs(self, run, previous_inputs, inputs) -> Dict[str, Any]:
"""
Same as 'load_inputs' but called after inputs have changed.
Work like 'load_inputs' but called after inputs have changed.
Note
----
Expand Down Expand Up @@ -263,7 +264,7 @@ def process(run, inputs) -> Dict[str, Any]:
Note
----
The passed inputs are cleaned and therefore differ
The passed inputs are cleaned and therefore differ
compared to 'load_inputs' or 'load_dependency_inputs'.
Please see '_clean_inputs' for more information.
Expand Down Expand Up @@ -369,7 +370,7 @@ def get_output_layout(register: Callable) -> dcc.Graph:
# Types dont match superclass
def load_outputs(run, inputs, outputs) -> go.Figure:
"""
Read the raw data and prepare it for the layout.
Read the raw data and prepare it for the layout.
Note
----
Expand Down
15 changes: 9 additions & 6 deletions deepcave/plugins/objective/configuration_cube.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,10 @@ def get_filter_layout(register: Callable) -> List[html.Div]:

def load_inputs(self) -> Dict[str, Any]:
"""
Load the content for the defined inputs in 'get_input_layout' and 'get_filter_layout'.
Load the content for the defined inputs in 'get_input_layout' and 'get_filter_layout'.
This method is necessary to pre-load contents for the inputs.
So, if the plugin is called for the first time or there are no results in the cache,
So, if the plugin is called for the first time or there are no results in the cache,
the plugin gets its content from this method.
Returns
Expand All @@ -160,13 +161,13 @@ def load_inputs(self) -> Dict[str, Any]:
# Types dont match superclass
def load_dependency_inputs(self, run, _, inputs) -> Dict[str, Any]:
"""
Same as 'load_inputs' but called after inputs have changed.
Work like 'load_inputs' but called after inputs have changed.
It is restricted to three Hyperparameters.
Note
----
Only the changes have to be returned.
Only the changes have to be returned.
The returned dictionary will be merged with the inputs.
Parameters
Expand Down Expand Up @@ -252,7 +253,8 @@ def process(run: AbstractRun, inputs: Dict[str, Any]) -> Dict[str, str]:
Note
----
The passed inputs are cleaned and therefore differs compared to 'load_inputs' or 'load_dependency_inputs'.
The passed inputs are cleaned and therefore differs compared to 'load_inputs'
or 'load_dependency_inputs'.
Please see '_clean_inputs' for more information.
Parameters
Expand Down Expand Up @@ -301,7 +303,8 @@ def load_outputs(run, inputs, outputs) -> go.Figure:
Note
----
The passed inputs are cleaned and therefore differs compared to 'load_inputs' or 'load_dependency_inputs'.
The passed inputs are cleaned and therefore differs compared to 'load_inputs'
or 'load_dependency_inputs'.
Please see '_clean_inputs' for more information.
Parameters
Expand Down
18 changes: 11 additions & 7 deletions deepcave/plugins/objective/cost_over_time.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ def check_runs_compatibility(self, runs: List[AbstractRun]) -> None:
"""
Check if the runs are compatible.
This function is needed if all selected runs need something in common (e.g. budget or objective).
Since this function is called before the layout is created,
This function is needed if all selected runs need something in common
(e.g. budget or objective).
Since this function is called before the layout is created,
it can be also used to set common values for the plugin.
Parameters
Expand Down Expand Up @@ -183,9 +184,10 @@ def get_filter_layout(register: Callable) -> List[Any]:

def load_inputs(self) -> Dict[str, Any]:
"""
Load the content for the defined inputs in 'get_input_layout' and 'get_filter_layout'.
This method is necessary to pre-load contents for the inputs.
So, if the plugin is called for the first time or there are no results in the cache,
Load the content for the defined inputs in 'get_input_layout' and 'get_filter_layout'.
This method is necessary to pre-load contents for the inputs.
So, if the plugin is called for the first time or there are no results in the cache,
the plugin gets its content from this method.
Returns
Expand Down Expand Up @@ -226,7 +228,8 @@ def process(run, inputs) -> Dict[str, Any]:
Note
----
The passed inputs are cleaned and therefore differs compared to 'load_inputs' or 'load_dependency_inputs'.
The passed inputs are cleaned and therefore differs compared to 'load_inputs'
or 'load_dependency_inputs'.
Please see '_clean_inputs' for more information.
Parameters
Expand Down Expand Up @@ -282,7 +285,8 @@ def load_outputs(runs, inputs, outputs) -> go.Figure:
Note
----
The passed inputs are cleaned and therefore differs compared to 'load_inputs' or 'load_dependency_inputs'.
The passed inputs are cleaned and therefore differs compared to 'load_inputs'
or 'load_dependency_inputs'.
Please see '_clean_inputs' for more information.
Parameters
Expand Down
Loading

0 comments on commit b40b6da

Please sign in to comment.