clarify tag filter

This commit is contained in:
revital 2023-10-25 10:34:30 +03:00
parent b82e5f11d0
commit 38fe264f83
2 changed files with 25 additions and 4 deletions

View File

@ -1443,7 +1443,8 @@ class Model(BaseModel):
To include All tags (instead of the default Any behaviour) use "__$all" as the first string, example: To include All tags (instead of the default Any behaviour) use "__$all" as the first string, example:
["__$all", "best", "model", "ever"] ["__$all", "best", "model", "ever"]
To combine All tags and exclude a list of tags use "__$not" before the excluded tags, example: To combine All tags and exclude a list of tags use "__$not" before the excluded tags, example:
["__$all", "best", "model", "ever", "__$not", "internal", "__$not", "test"] ["__$all", "best", "model", "ever", "__$not", "internal", "__$not", "test"]. See
https://clear.ml/docs/latest/docs/clearml_sdk/model_sdk#tag-filters for more information.
:param only_published: If True, only return published models. :param only_published: If True, only return published models.
:param include_archived: If True, return archived models. :param include_archived: If True, return archived models.
:param max_results: Optional return the last X models, :param max_results: Optional return the last X models,

View File

@ -930,7 +930,17 @@ class Task(_Task):
:param str project_name: The project name of the Task to get. :param str project_name: The project name of the Task to get.
:param str task_name: The name of the Task within ``project_name`` to get. :param str task_name: The name of the Task within ``project_name`` to get.
:param list tags: Filter based on the requested list of tags (strings) (Task must have at least one of the :param list tags: Filter based on the requested list of tags (strings) (Task must have at least one of the
listed tags). To exclude a tag add "-" prefix to the tag. Example: ["best", "-debug"] listed tags). To exclude a tag add "-" prefix to the tag. Example: ["best", "-debug"].
The default behaviour is to join all tags with a logical "OR" operator.
To join all tags with a logical "AND" operator instead, use "__$all" as the first string, for example:
["__$all", "best", "experiment", "ever"]
To join all tags with AND, but exclude a tag use "__$not" before the excluded tag, for example:
["__$all", "best", "experiment", "ever", "__$not", "internal", "__$not", "test"]
The "OR" and "AND" operators apply to all tags that follow them until another operator is specified.
The NOT operator applies only to the immediately following tag.
For example, ["__$all", "a", "b", "c", "__$or", "d", "__$not", "e", "__$and", "__$or" "f", "g"]
means ("a" AND "b" AND "c" AND ("d" OR NOT "e") AND ("f" OR "g")).
See https://clear.ml/docs/latest/docs/clearml_sdk/task_sdk/#tag-filters for more information.
:param bool allow_archived: Only applicable if *not* using specific ``task_id``, :param bool allow_archived: Only applicable if *not* using specific ``task_id``,
If True (default), allow to return archived Tasks, if False filter out archived Tasks If True (default), allow to return archived Tasks, if False filter out archived Tasks
:param bool task_filter: Only applicable if *not* using specific ``task_id``, :param bool task_filter: Only applicable if *not* using specific ``task_id``,
@ -978,8 +988,18 @@ class Task(_Task):
avoid any regex behaviour, use re.escape()). (Optional) avoid any regex behaviour, use re.escape()). (Optional)
To match an exact task name (i.e. not partial matching), To match an exact task name (i.e. not partial matching),
add ^/$ at the beginning/end of the string, for example: "^exact_task_name_here$" add ^/$ at the beginning/end of the string, for example: "^exact_task_name_here$"
:param list tags: Filter based on the requested list of tags (strings) (Task must have all the listed tags) :param list tags: Filter based on the requested list of tags (strings) (Task must have at least one of the
To exclude a tag add "-" prefix to the tag. Example: ["best", "-debug"] listed tags). To exclude a tag add "-" prefix to the tag. Example: ["best", "-debug"].
The default behaviour is to join all tags with a logical "OR" operator.
To join all tags with a logical "AND" operator instead, use "__$all" as the first string, for example:
["__$all", "best", "experiment", "ever"]
To join all tags with AND, but exclude a tag use "__$not" before the excluded tag, for example:
["__$all", "best", "experiment", "ever", "__$not", "internal", "__$not", "test"]
The "OR" and "AND" operators apply to all tags that follow them until another operator is specified.
The NOT operator applies only to the immediately following tag.
For example, ["__$all", "a", "b", "c", "__$or", "d", "__$not", "e", "__$and", "__$or" "f", "g"]
means ("a" AND "b" AND "c" AND ("d" OR NOT "e") AND ("f" OR "g")).
See https://clear.ml/docs/latest/docs/clearml_sdk/task_sdk/#tag-filters for more information.
:param bool allow_archived: If True (default), allow to return archived Tasks, if False filter out archived Tasks :param bool allow_archived: If True (default), allow to return archived Tasks, if False filter out archived Tasks
:param dict task_filter: filter and order Tasks. :param dict task_filter: filter and order Tasks.
See :class:`.backend_api.service.v?.tasks.GetAllRequest` for details; the ? needs to be replaced by the appropriate version. See :class:`.backend_api.service.v?.tasks.GetAllRequest` for details; the ? needs to be replaced by the appropriate version.