From 0212637cecd26c22964df3e34b4730515180fa82 Mon Sep 17 00:00:00 2001 From: pollfly <75068813+pollfly@users.noreply.github.com> Date: Wed, 10 Jan 2024 14:40:19 +0200 Subject: [PATCH] Small edits (#753) --- docs/apps/clearml_task.md | 2 +- docs/clearml_agent.md | 8 +++++--- docs/clearml_data/clearml_data_sdk.md | 1 + docs/clearml_sdk/apiclient_sdk.md | 1 + docs/clearml_sdk/task_sdk.md | 2 ++ docs/faq.md | 1 + docs/getting_started/mlops/mlops_first_steps.md | 9 ++++++++- docs/guides/clearml_agent/executable_exp_containers.md | 2 +- docs/guides/set_offline.md | 1 + docs/integrations/autokeras.md | 1 + docs/integrations/catboost.md | 1 + docs/integrations/click.md | 1 + docs/integrations/fastai.md | 1 + docs/integrations/hydra.md | 1 + docs/integrations/ignite.md | 1 + docs/integrations/keras.md | 1 + docs/integrations/lightgbm.md | 1 + docs/integrations/megengine.md | 1 + docs/integrations/python_fire.md | 1 + docs/integrations/pytorch.md | 1 + docs/integrations/pytorch_lightning.md | 1 + docs/integrations/scikit_learn.md | 1 + docs/integrations/seaborn.md | 1 + docs/integrations/tensorboard.md | 1 + docs/integrations/tensorboardx.md | 1 + docs/integrations/tensorflow.md | 1 + docs/integrations/xgboost.md | 1 + docs/model_registry.md | 1 + docs/pipelines/pipelines_sdk_tasks.md | 1 + 29 files changed, 41 insertions(+), 6 deletions(-) diff --git a/docs/apps/clearml_task.md b/docs/apps/clearml_task.md index 61fc6a41..85ee9585 100644 --- a/docs/apps/clearml_task.md +++ b/docs/apps/clearml_task.md @@ -80,7 +80,7 @@ errors in identifying the correct default branch. ## Usage -These commands demonstrate a few useful use cases for `clearml-task` +These commands demonstrate a few useful use cases for `clearml-task`. ### Executing Code from a Remote Repository diff --git a/docs/clearml_agent.md b/docs/clearml_agent.md index 51fefbab..785df277 100644 --- a/docs/clearml_agent.md +++ b/docs/clearml_agent.md @@ -799,9 +799,11 @@ APIClient. The body of the call must contain the ``queue-id`` and the tags to ad For example, force workers on for a queue using the APIClient: - from clearml.backend_api.session.client import APIClient - client = APIClient() - client.queues.update(queue="", tags=["force_workers:on"] +```python +from clearml.backend_api.session.client import APIClient +client = APIClient() +client.queues.update(queue="", tags=["force_workers:on"]) +``` Or, force workers on for a queue using the REST API: diff --git a/docs/clearml_data/clearml_data_sdk.md b/docs/clearml_data/clearml_data_sdk.md index bcd93724..f77f148c 100644 --- a/docs/clearml_data/clearml_data_sdk.md +++ b/docs/clearml_data/clearml_data_sdk.md @@ -335,6 +335,7 @@ You can enable offline mode in one of the following ways: ```python from clearml import Dataset + # Use the set_offline class method before creating a Dataset Dataset.set_offline(offline_mode=True) # Create a dataset diff --git a/docs/clearml_sdk/apiclient_sdk.md b/docs/clearml_sdk/apiclient_sdk.md index 652f1a6e..fd62342d 100644 --- a/docs/clearml_sdk/apiclient_sdk.md +++ b/docs/clearml_sdk/apiclient_sdk.md @@ -25,6 +25,7 @@ in your workspace. The following code uses APIClient to retrieve a list of all p ```python from clearml.backend_api.session.client import APIClient + # Create an instance of APIClient client = APIClient() project_list = client.projects.get_all(name="example*") diff --git a/docs/clearml_sdk/task_sdk.md b/docs/clearml_sdk/task_sdk.md index fc99632d..c892a11a 100644 --- a/docs/clearml_sdk/task_sdk.md +++ b/docs/clearml_sdk/task_sdk.md @@ -560,6 +560,7 @@ the `offline_mode` argument to `True` ```python from clearml import Task + # Use the set_offline class method before initializing a Task Task.set_offline(offline_mode=True) # Initialize a Task @@ -594,6 +595,7 @@ Upload the execution data that the Task captured offline to the ClearML Server u * [`Task.import_offline_session`](../references/sdk/task.md#taskimport_offline_session) class method ```python from clearml import Task + Task.import_offline_session(session_folder_zip="path/to/session/.clearml/cache/offline/b786845decb14eecadf2be24affc7418.zip") ``` diff --git a/docs/faq.md b/docs/faq.md index f586676b..a6e9629d 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -1136,6 +1136,7 @@ in your workspace. The following code uses APIClient to retrieve a list of all p ```python from clearml.backend_api.session.client import APIClient + # Create an instance of APIClient client = APIClient() project_list = client.projects.get_all(name="example*") diff --git a/docs/getting_started/mlops/mlops_first_steps.md b/docs/getting_started/mlops/mlops_first_steps.md index 04491bb2..a0316676 100644 --- a/docs/getting_started/mlops/mlops_first_steps.md +++ b/docs/getting_started/mlops/mlops_first_steps.md @@ -97,6 +97,7 @@ All Tasks in the system can be accessed through their unique Task ID, or based o method. For example: ```python from clearml import Task + executed_task = Task.get_task(task_id='aabbcc') ``` @@ -130,6 +131,7 @@ Users can programmatically change cloned experiments' parameters. For example: ```python from clearml import Task + cloned_task = Task.clone(task_id='aabbcc') cloned_task.set_parameter(name='internal/magic', value=42) ``` @@ -141,6 +143,7 @@ objects and files to a task anywhere from code. ```python import numpy as np from clearml import Task + Task.current_task().upload_artifact(name='a_file', artifact_object='local_file.bin') Task.current_task().upload_artifact(name='numpy', artifact_object=np.ones(4,4)) ``` @@ -150,6 +153,7 @@ by accessing the Task that created them. These artifacts can be modified and upl ```python from clearml import Task + executed_task = Task.get_task(task_id='aabbcc') # artifact as a file local_file = executed_task.artifacts['file'].get_local_copy() @@ -173,6 +177,7 @@ improves the visibility of your processes’ progress. ```python from clearml import Logger + Logger.current_logger().report_scalar( graph='metric', series='variant', @@ -184,6 +189,7 @@ Logger.current_logger().report_scalar( You can also retrieve reported scalars for programmatic analysis: ```python from clearml import Task + executed_task = Task.get_task(task_id='aabbcc') # get a summary of the min/max/last value of all reported scalars min_max_values = executed_task.get_last_scalar_metrics() @@ -193,10 +199,11 @@ full_scalars = executed_task.get_reported_scalars() #### Query Experiments You can also search and query Tasks in the system. Use the [`Task.get_tasks`](../../references/sdk/task.md#taskget_tasks) -method to retrieve Task objects and filter based on the specific values of the Task - status, parameters, metrics and more! +class method to retrieve Task objects and filter based on the specific values of the Task - status, parameters, metrics and more! ```python from clearml import Task + tasks = Task.get_tasks( project_name='examples', task_name='partial_name_match', diff --git a/docs/guides/clearml_agent/executable_exp_containers.md b/docs/guides/clearml_agent/executable_exp_containers.md index 3ab0b680..300846c8 100644 --- a/docs/guides/clearml_agent/executable_exp_containers.md +++ b/docs/guides/clearml_agent/executable_exp_containers.md @@ -35,7 +35,7 @@ script. This ID will be used in the following section. ## Building and Launching a Containerized Task -1. Execute the following command to build the container. Input the ID of the task created above. +1. Execute the following command to build the container. Input the ID of the task created above: ```console clearml-agent build --id --docker --target new-docker --entry-point clone_task ``` diff --git a/docs/guides/set_offline.md b/docs/guides/set_offline.md index f011af03..713a4d20 100644 --- a/docs/guides/set_offline.md +++ b/docs/guides/set_offline.md @@ -14,6 +14,7 @@ the `offline_mode` argument to `True` ```python from clearml import Task + # Use the set_offline class method before initializing a Task Task.set_offline(offline_mode=True) # Initialize a Task diff --git a/docs/integrations/autokeras.md b/docs/integrations/autokeras.md index 170c0928..b8bad96a 100644 --- a/docs/integrations/autokeras.md +++ b/docs/integrations/autokeras.md @@ -13,6 +13,7 @@ All you have to do is simply add two lines of code to your AutoKeras script: ```python from clearml import Task + task = Task.init(task_name="", project_name="") ``` diff --git a/docs/integrations/catboost.md b/docs/integrations/catboost.md index f64e900c..c774caa2 100644 --- a/docs/integrations/catboost.md +++ b/docs/integrations/catboost.md @@ -13,6 +13,7 @@ All you have to do is simply add two lines of code to your CatBoost script: ```python from clearml import Task + task = Task.init(task_name="", project_name="") ``` diff --git a/docs/integrations/click.md b/docs/integrations/click.md index 21525a65..3290e980 100644 --- a/docs/integrations/click.md +++ b/docs/integrations/click.md @@ -14,6 +14,7 @@ All you have to do is add two lines of code: ```python from clearml import Task + task = Task.init(task_name="", project_name="") ``` diff --git a/docs/integrations/fastai.md b/docs/integrations/fastai.md index 1fd3af67..61a0483c 100644 --- a/docs/integrations/fastai.md +++ b/docs/integrations/fastai.md @@ -13,6 +13,7 @@ All you have to do is simply add two lines of code to your `fastai` script: ```python from clearml import Task + task = Task.init(task_name="", project_name="") ``` diff --git a/docs/integrations/hydra.md b/docs/integrations/hydra.md index 1df3e3a6..68d31302 100644 --- a/docs/integrations/hydra.md +++ b/docs/integrations/hydra.md @@ -16,6 +16,7 @@ All you have to do is add two lines of code: ```python from clearml import Task + task = Task.init(task_name="", project_name="") ``` diff --git a/docs/integrations/ignite.md b/docs/integrations/ignite.md index cff03ad7..cfd539d9 100644 --- a/docs/integrations/ignite.md +++ b/docs/integrations/ignite.md @@ -20,6 +20,7 @@ All you have to do is add two lines of code to your script: ```python from clearml import Task + task = Task.init(task_name="", project_name="") ``` diff --git a/docs/integrations/keras.md b/docs/integrations/keras.md index 698c9465..f09814c3 100644 --- a/docs/integrations/keras.md +++ b/docs/integrations/keras.md @@ -14,6 +14,7 @@ All you have to do is simply add two lines of code to your Keras script: ```python from clearml import Task + task = Task.init(task_name="", project_name="") ``` diff --git a/docs/integrations/lightgbm.md b/docs/integrations/lightgbm.md index b1ff4c80..db48bfc7 100644 --- a/docs/integrations/lightgbm.md +++ b/docs/integrations/lightgbm.md @@ -14,6 +14,7 @@ All you have to do is simply add two lines of code to your LightGBM script: ```python from clearml import Task + task = Task.init(task_name="", project_name="") ``` diff --git a/docs/integrations/megengine.md b/docs/integrations/megengine.md index 06a210f9..7134a411 100644 --- a/docs/integrations/megengine.md +++ b/docs/integrations/megengine.md @@ -13,6 +13,7 @@ All you have to do is simply add two lines of code to your MegEngine script: ```python from clearml import Task + task = Task.init(task_name="", project_name="") ``` diff --git a/docs/integrations/python_fire.md b/docs/integrations/python_fire.md index 5f283ca5..8aae12b6 100644 --- a/docs/integrations/python_fire.md +++ b/docs/integrations/python_fire.md @@ -9,6 +9,7 @@ All you have to do is add two lines of code: ```python from clearml import Task + task = Task.init(task_name="", project_name="") ``` diff --git a/docs/integrations/pytorch.md b/docs/integrations/pytorch.md index 396be7d0..d831d440 100644 --- a/docs/integrations/pytorch.md +++ b/docs/integrations/pytorch.md @@ -13,6 +13,7 @@ All you have to do is simply add two lines of code to your PyTorch script: ```python from clearml import Task + task = Task.init(task_name="", project_name="") ``` diff --git a/docs/integrations/pytorch_lightning.md b/docs/integrations/pytorch_lightning.md index dc62a0b1..63ae09fc 100644 --- a/docs/integrations/pytorch_lightning.md +++ b/docs/integrations/pytorch_lightning.md @@ -15,6 +15,7 @@ All you have to do is simply add two lines of code to your PyTorch Lightning scr ```python from clearml import Task + task = Task.init(task_name="", project_name="") ``` diff --git a/docs/integrations/scikit_learn.md b/docs/integrations/scikit_learn.md index 77b7d370..f5fe2eda 100644 --- a/docs/integrations/scikit_learn.md +++ b/docs/integrations/scikit_learn.md @@ -14,6 +14,7 @@ All you have to do is simply add two lines of code to your scikit-learn script: ```python from clearml import Task + task = Task.init(task_name="", project_name="") ``` diff --git a/docs/integrations/seaborn.md b/docs/integrations/seaborn.md index 0322357d..6c6114ae 100644 --- a/docs/integrations/seaborn.md +++ b/docs/integrations/seaborn.md @@ -13,6 +13,7 @@ lines of code to your script: ```python from clearml import Task + task = Task.init(task_name="", project_name="") ``` diff --git a/docs/integrations/tensorboard.md b/docs/integrations/tensorboard.md index d0bbbcdb..d7e2d946 100644 --- a/docs/integrations/tensorboard.md +++ b/docs/integrations/tensorboard.md @@ -12,6 +12,7 @@ lines of code to your script: ```python from clearml import Task + task = Task.init(task_name="", project_name="") ``` diff --git a/docs/integrations/tensorboardx.md b/docs/integrations/tensorboardx.md index be8732d9..28681520 100644 --- a/docs/integrations/tensorboardx.md +++ b/docs/integrations/tensorboardx.md @@ -13,6 +13,7 @@ to do is add two lines of code to your script: ```python from clearml import Task + task = Task.init(task_name="", project_name="") ``` diff --git a/docs/integrations/tensorflow.md b/docs/integrations/tensorflow.md index 7bac4d24..7254c16b 100644 --- a/docs/integrations/tensorflow.md +++ b/docs/integrations/tensorflow.md @@ -14,6 +14,7 @@ All you have to do is simply add two lines of code to your TensorFlow script: ```python from clearml import Task + task = Task.init(task_name="", project_name="") ``` diff --git a/docs/integrations/xgboost.md b/docs/integrations/xgboost.md index aa0d9400..4ce738b8 100644 --- a/docs/integrations/xgboost.md +++ b/docs/integrations/xgboost.md @@ -14,6 +14,7 @@ All you have to do is simply add two lines of code to your XGBoost script: ```python from clearml import Task + task = Task.init(task_name="", project_name="") ``` diff --git a/docs/model_registry.md b/docs/model_registry.md index af9d0b43..71180cf3 100644 --- a/docs/model_registry.md +++ b/docs/model_registry.md @@ -58,6 +58,7 @@ names that start with `final`. ```python from clearml import Task + task = Task.init( project_name="My Project", task_name="My Task", diff --git a/docs/pipelines/pipelines_sdk_tasks.md b/docs/pipelines/pipelines_sdk_tasks.md index 6d3ea2bf..2ad0f102 100644 --- a/docs/pipelines/pipelines_sdk_tasks.md +++ b/docs/pipelines/pipelines_sdk_tasks.md @@ -8,6 +8,7 @@ Create the [PipelineController](../references/sdk/automation_controller_pipeline the pipeline's execution logic: ```python from clearml import PipelineController + pipe = PipelineController( name="Pipeline Controller", project="Pipeline example", version="1.0.0" )