From 62647244ed2980bd125d149251f597169c793175 Mon Sep 17 00:00:00 2001 From: clearml <> Date: Sun, 12 Jan 2025 18:25:48 +0200 Subject: [PATCH] Fix docstring documentation rendering issues --- clearml/automation/controller.py | 2 +- clearml/automation/job.py | 2 +- clearml/automation/optimization.py | 2 +- clearml/logger.py | 6 ++++-- clearml/model.py | 3 ++- clearml/task.py | 2 +- 6 files changed, 10 insertions(+), 7 deletions(-) diff --git a/clearml/automation/controller.py b/clearml/automation/controller.py index 3ee39ab1..1e9dd7cd 100644 --- a/clearml/automation/controller.py +++ b/clearml/automation/controller.py @@ -1223,7 +1223,7 @@ class PipelineController(object): :param bool wait_on_upload: Whether the upload should be synchronous, forcing the upload to complete before continuing. - :param Callable[Any, Union[bytes, bytearray]] serialization_function: A serialization function that takes one + :param serialization_function: A serialization function that takes one parameter of any type which is the object to be serialized. The function should return a `bytes` or `bytearray` object, which represents the serialized object. Note that the object will be immediately serialized using this function, thus other serialization methods will not be used diff --git a/clearml/automation/job.py b/clearml/automation/job.py index 0498c25d..65803198 100644 --- a/clearml/automation/job.py +++ b/clearml/automation/job.py @@ -546,7 +546,7 @@ class ClearmlJob(BaseJob): If True, use the base_task_id directly (base-task must be in draft-mode / created), :param bool allow_caching: If True, check if we have a previously executed Task with the same specification. If we do, use it and set internal is_cached flag. Default False (always create new Task). - :param Union[str, bool] output_uri: The storage / output url for this job. This is the default location for + :param output_uri: The storage / output url for this job. This is the default location for output models and other artifacts. Check Task.init reference docs for more info (output_uri is a parameter). :param str target_project: Optional, Set the target project name to create the cloned Task in. :param enable_local_imports: If True, allow jobs to import from local files diff --git a/clearml/automation/optimization.py b/clearml/automation/optimization.py index 02c3504b..df7d421c 100644 --- a/clearml/automation/optimization.py +++ b/clearml/automation/optimization.py @@ -1290,7 +1290,7 @@ class HyperParameterOptimizer(object): :param str base_task_id: The Task ID to be used as template experiment to optimize. :param list hyper_parameters: The list of Parameter objects to optimize over. - :param Union[str, Sequence[str]] objective_metric_title: The Objective metric title(s) to maximize / minimize + :param objective_metric_title: The Objective metric title(s) to maximize / minimize (for example, ``validation``, ``["validation", "loss"]``). If ``objective_metric_title`` is a sequence (used to optimize multiple objectives at the same time), then ``objective_metric_series`` and ``objective_metric_sign`` have to be sequences of the same length. Each title will be matched diff --git a/clearml/logger.py b/clearml/logger.py index fe0a19df..ee3e35c3 100644 --- a/clearml/logger.py +++ b/clearml/logger.py @@ -230,7 +230,7 @@ class Logger(object): :param xaxis: The x-axis title. (Optional) :param yaxis: The y-axis title. (Optional) :param mode: Multiple histograms mode, stack / group / relative. Default is 'group'. - :param extra_layout: optional dictionary for layout configuration, passed directly to plotly + :param extra_layout: Optional dictionary for layout configuration, passed directly to plotly. See full details on the supported configuration: https://plotly.com/javascript/reference/layout/ example: ``extra_layout={'showlegend': False, 'plot_bgcolor': 'yellow'}`` """ @@ -266,6 +266,7 @@ class Logger(object): data_args=None, # type: Optional[dict] extra_layout=None, # type: Optional[dict] ): + # type: (...) -> () """ For explicit reporting, plot a (default grouped) histogram. Notice this function will not calculate the histogram, @@ -590,12 +591,13 @@ class Logger(object): comment=None, # type: Optional[str] extra_layout=None, # type: Optional[dict] ): + # type: (...) -> () """ For explicit reporting, plot a 3d scatter graph (with markers). :param str title: The title (metric) of the plot. :param str series: The series name (variant) of the reported scatter plot. - :param Union[numpy.ndarray, list] scatter: The scatter data. + :param scatter: The scatter data. list of (pairs of x,y,z), list of series [[(x1,y1,z1)...]], or numpy.ndarray :param int iteration: The reported iteration / step. :param str xaxis: The x-axis title. (Optional) diff --git a/clearml/model.py b/clearml/model.py index 0c76426b..58813cfe 100644 --- a/clearml/model.py +++ b/clearml/model.py @@ -818,12 +818,13 @@ class BaseModel(object): comment=None, # type: Optional[str] extra_layout=None # type: Optional[dict] ): + # type: (...) -> () """ For explicit reporting, plot a 3d scatter graph (with markers). :param str title: The title (metric) of the plot. :param str series: The series name (variant) of the reported scatter plot. - :param Union[numpy.ndarray, list] scatter: The scatter data. + :param scatter: The scatter data. list of (pairs of x,y,z), list of series [[(x1,y1,z1)...]], or numpy.ndarray :param int iteration: The reported iteration / step. :param str xaxis: The x-axis title. (Optional) diff --git a/clearml/task.py b/clearml/task.py index 22a9cfd9..215ffea4 100644 --- a/clearml/task.py +++ b/clearml/task.py @@ -2684,7 +2684,7 @@ class Task(_Task): - PIL.Image - whatever extensions PIL supports (default ``.png``) - In case the ``serialization_function`` argument is set - any extension is supported - :param Callable[Any, Union[bytes, bytearray]] serialization_function: A serialization function that takes one + :param serialization_function: A serialization function that takes one parameter of any type which is the object to be serialized. The function should return a `bytes` or `bytearray` object, which represents the serialized object. Note that the object will be immediately serialized using this function, thus other serialization methods will not be used