mirror of
https://github.com/clearml/clearml
synced 2025-04-23 15:55:45 +00:00
Sphinx compatibility
This commit is contained in:
parent
2fb69ae951
commit
d0b1c6acb5
@ -493,6 +493,7 @@ class Task(IdObjectBase, AccessMixin, SetupUploadMixin):
|
||||
def set_input_model(self, model_id=None, model_name=None, update_task_design=True, update_task_labels=True):
|
||||
"""
|
||||
Set a new input model for this task. Model must be 'ready' in order to be used as the Task's input model.
|
||||
|
||||
:param model_id: ID for a model that exists in the backend. Required if model_name is not provided.
|
||||
:param model_name: Model name. Required if model_id is not provided. If provided, this name will be used to
|
||||
locate an existing model in the backend.
|
||||
@ -543,8 +544,9 @@ class Task(IdObjectBase, AccessMixin, SetupUploadMixin):
|
||||
"""
|
||||
Set parameters for this task. This allows setting a complete set of key/value parameters, but does not support
|
||||
parameter descriptions (as the input is a dictionary or key/value pairs.
|
||||
|
||||
:param args: Positional arguments (one or more dictionary or (key, value) iterable). These will be merged into
|
||||
a single key/value dictionary.
|
||||
a single key/value dictionary.
|
||||
:param kwargs: Key/value pairs, merged into the parameters dictionary created from `args`.
|
||||
"""
|
||||
if not all(isinstance(x, (dict, collections.Iterable)) for x in args):
|
||||
@ -581,6 +583,7 @@ class Task(IdObjectBase, AccessMixin, SetupUploadMixin):
|
||||
def set_parameter(self, name, value, description=None):
|
||||
"""
|
||||
Set a single task parameter. This overrides any previous value for this parameter.
|
||||
|
||||
:param name: Parameter name
|
||||
:param value: Parameter value
|
||||
:param description: Parameter description (unused for now)
|
||||
@ -592,6 +595,7 @@ class Task(IdObjectBase, AccessMixin, SetupUploadMixin):
|
||||
def get_parameter(self, name, default=None):
|
||||
"""
|
||||
Get a value for a parameter.
|
||||
|
||||
:param name: Parameter name
|
||||
:param default: Default value
|
||||
:return: Parameter value (or default value if parameter is not defined)
|
||||
@ -607,12 +611,17 @@ class Task(IdObjectBase, AccessMixin, SetupUploadMixin):
|
||||
parameter descriptions (as the input is a dictionary or key/value pairs.
|
||||
|
||||
:param args: Positional arguments (one or more dictionary or (key, value) iterable). These will be merged into
|
||||
a single key/value dictionary.
|
||||
a single key/value dictionary.
|
||||
:param kwargs: Key/value pairs, merged into the parameters dictionary created from `args`.
|
||||
"""
|
||||
self.set_parameters(__update=True, *args, **kwargs)
|
||||
|
||||
def set_model_label_enumeration(self, enumeration=None):
|
||||
"""
|
||||
Set a dictionary of labels (text) to ids (integers) {str(label): integer(id)}
|
||||
|
||||
:param dict enumeration: For example: {str(label): integer(id)}
|
||||
"""
|
||||
enumeration = enumeration or {}
|
||||
execution = self.data.execution
|
||||
if enumeration is None:
|
||||
@ -633,7 +642,7 @@ class Task(IdObjectBase, AccessMixin, SetupUploadMixin):
|
||||
def get_labels_enumeration(self):
|
||||
"""
|
||||
Return a dictionary of labels (text) to ids (integers) {str(label): integer(id)}
|
||||
:return:
|
||||
:return: dict
|
||||
"""
|
||||
if not self.data or not self.data.execution:
|
||||
return {}
|
||||
@ -728,6 +737,7 @@ class Task(IdObjectBase, AccessMixin, SetupUploadMixin):
|
||||
tags=None, parent=None, project=None, log=None, session=None):
|
||||
"""
|
||||
Clone a task
|
||||
|
||||
:param cloned_task_id: Task ID for the task to be cloned
|
||||
:type cloned_task_id: str
|
||||
:param name: New for the new task
|
||||
@ -779,12 +789,14 @@ class Task(IdObjectBase, AccessMixin, SetupUploadMixin):
|
||||
@classmethod
|
||||
def get_all(cls, session=None, log=None, **kwargs):
|
||||
"""
|
||||
Get all tasks
|
||||
List all tasks based on specific projection
|
||||
|
||||
:param session: Session object used for sending requests to the API
|
||||
:type session: Session
|
||||
:param log: Log object
|
||||
:type log: logging.Logger
|
||||
:param kwargs: Keyword args passed to the GetAllRequest (see .backend_api.services.tasks.GetAllRequest)
|
||||
Example: status='completed', 'search_text'='specific_word', 'user'='user_id', 'project'='project_id'
|
||||
:type kwargs: dict
|
||||
:return: API response
|
||||
"""
|
||||
|
@ -6,6 +6,13 @@
|
||||
# Defaults to system temp folder / cache
|
||||
default_base_dir: "~/.trains/cache"
|
||||
}
|
||||
|
||||
direct_access: [
|
||||
# Objects matching are considered to be available for direct access, i.e. they will not eb downloaded
|
||||
# or cached, and any download request will return a direct reference.
|
||||
# Objects are specified in glob format, available for url and content_type.
|
||||
{ url: "file://*" } # file-urls are always directly referenced
|
||||
]
|
||||
}
|
||||
|
||||
metrics {
|
||||
|
@ -90,9 +90,8 @@ class Task(_Task):
|
||||
|
||||
def __init__(self, private=None, **kwargs):
|
||||
"""
|
||||
**Do not construct Task manually!**
|
||||
|
||||
please use Task.current_task() or Task.get_task(id=, project=, name=)
|
||||
Do not construct Task manually!
|
||||
**Please use Task.init() or Task.get_task(id=, project=, name=)**
|
||||
"""
|
||||
if private is not Task.__create_protection:
|
||||
raise UsageError(
|
||||
@ -461,7 +460,7 @@ class Task(_Task):
|
||||
:param task_id: unique task id string (if exists other parameters are ignored)
|
||||
:param project_name: project name (str) the task belongs to
|
||||
:param task_name: task name (str) in within the selected project
|
||||
:return: Task object
|
||||
:return: Task() object
|
||||
"""
|
||||
return Task.__get_task(task_id=task_id, project_name=project_name, task_name=task_name)
|
||||
|
||||
@ -552,7 +551,7 @@ class Task(_Task):
|
||||
If a logger was created before, this will be the new period and
|
||||
the old one will be discarded.
|
||||
|
||||
:return: .Logger object
|
||||
:return: Logger object
|
||||
"""
|
||||
if not self._logger:
|
||||
# force update of base logger to this current task (this is the main logger task)
|
||||
@ -596,7 +595,6 @@ class Task(_Task):
|
||||
flush any outstanding reports or console logs
|
||||
|
||||
:param wait_for_uploads: if True the flush will exit only after all outstanding uploads are completed
|
||||
:return: True
|
||||
"""
|
||||
|
||||
# make sure model upload is done
|
||||
@ -639,6 +637,7 @@ class Task(_Task):
|
||||
"""
|
||||
Add artifact for the current Task, used mostly for Data Audition.
|
||||
Currently supported artifacts object types: pandas.DataFrame
|
||||
|
||||
:param name: name of the artifacts. can override previous artifacts if name already exists
|
||||
:type name: str
|
||||
:param artifact: artifact object, supported artifacts object types: pandas.DataFrame
|
||||
@ -688,7 +687,7 @@ class Task(_Task):
|
||||
Get Task model configuration text (before creating an output model)
|
||||
When an output model is created it will inherit these properties
|
||||
|
||||
:return model config_text (unconstrained text string). usually the content of a configuration file.
|
||||
:return: model config_text (unconstrained text string). usually the content of a configuration file.
|
||||
If `config_text` is not None, `config_dict` must not be provided.
|
||||
"""
|
||||
return super(Task, self).get_model_design()
|
||||
@ -698,7 +697,7 @@ class Task(_Task):
|
||||
Get Task model configuration dictionary (before creating an output model)
|
||||
When an output model is created it will inherit these properties
|
||||
|
||||
:return model config_text (unconstrained text string). usually the content of a configuration file.
|
||||
:return: model config_text (unconstrained text string). usually the content of a configuration file.
|
||||
If `config_text` is not None, `config_dict` must not be provided.
|
||||
"""
|
||||
config_text = self.get_model_config_text()
|
||||
@ -719,7 +718,7 @@ class Task(_Task):
|
||||
Return the last reported iteration (i.e. the maximum iteration the task reported a metric for)
|
||||
Notice, this is not a cached call, it will ask the backend for the answer (no local caching)
|
||||
|
||||
:return integer, last reported iteration number
|
||||
:return: last reported iteration number (integer)
|
||||
"""
|
||||
self.reload()
|
||||
return self.data.last_iteration
|
||||
@ -740,7 +739,9 @@ class Task(_Task):
|
||||
"""
|
||||
Set new default TRAINS-server host and credentials
|
||||
These configurations will be overridden by wither OS environment variables or trains.conf configuration file
|
||||
Notice: credentials needs to be set prior to Task initialization
|
||||
|
||||
Notice! credentials needs to be set *prior* to Task initialization
|
||||
|
||||
:param host: host url, example: host='http://localhost:8008'
|
||||
:type host: str
|
||||
:param key: user key/secret pair, example: key='thisisakey123'
|
||||
|
Loading…
Reference in New Issue
Block a user