From 21c9492ffdd5222bd6ffe346394a1ddbd2116ff8 Mon Sep 17 00:00:00 2001 From: Lautaro Rangil Date: Wed, 22 Mar 2023 18:01:25 -0300 Subject: [PATCH 01/17] v2.14.0 --- .pre-commit-config.yaml | 4 ++ README.rst | 36 ++++++++++++++++- scaleapi/__init__.py | 89 ++++++++++++++++++++++++++++++++++++++++- scaleapi/_version.py | 2 +- tests/t_studio.py | 2 +- tests/test_client.py | 5 +++ 6 files changed, 134 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3bb7b03..0a714f5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -25,6 +25,10 @@ repos: rev: 3.8.4 hooks: - id: flake8 +# - repo: https://github.com/pycqa/flake8 +# rev: 3.9.2 +# hooks: +# - id: flake8 - repo: local hooks: - id: pylint diff --git a/README.rst b/README.rst index 2d17a2c..1b0f02c 100644 --- a/README.rst +++ b/README.rst @@ -533,6 +533,24 @@ __ https://docs.scale.com/reference#project-update-parameters instruction="update: Please label all the stuff", ) +Update Ontology +^^^^^^^^^^^^^^ +Creates a new version of the Project Ontology. Check out `Scale's API documentation`__ for more information. +__ https://docs.scale.com/reference#project-update-ontology +.. code-block :: python + data = client.update_ontology( + project_name="test_project", + project_ontology=[ + "Road", + { + "choice": "Vehicle", + "description": "a means of carrying or transporting material", + "subchoices": ["Car", "Truck", "Train", "Motorcycle"] + }, + ], + ontology_name="test_ontology", + ) + Files ________ @@ -630,7 +648,7 @@ Returns all teammates in a List of Teammate objects. from scaleapi import TeammateRole teammates = client.invite_teammates(['email1@example.com', 'email2@example.com'], TeammateRole.Member) - + Update Teammate Role ^^^^^^^^^^^^^^^^^^^^^ @@ -731,6 +749,22 @@ Create a training task. client.create_training_task(TaskType, ...task parameters...) Studio Assignments (For Scale Studio only) + +List Training Attempts +^^^^^^^^^^^^^^^^^^^^^^^ + +Retrieves a list of training attempts by labelers. + +.. code-block:: python + + client.list_training_attempts( + quality_task_ids: Optional[List[str]] = None, + labeler_emails: Optional[List[str]] = None, + next_token: Optional[str] = None, + limit: Optional[int] = None, + ) + + __________________________________________ Manage project assignments for your labelers. diff --git a/scaleapi/__init__.py b/scaleapi/__init__.py index 7e4368e..16c1bca 100644 --- a/scaleapi/__init__.py +++ b/scaleapi/__init__.py @@ -1,4 +1,4 @@ -from typing import IO, Dict, Generator, Generic, List, TypeVar, Union +from typing import IO, Dict, Generator, Generic, List, Optional, TypeVar, Union from scaleapi.batches import Batch, BatchStatus from scaleapi.evaluation_tasks import EvaluationTask @@ -1245,3 +1245,90 @@ def reset_studio_batches_priorities(self) -> List[StudioBatch]: endpoint = "studio/batches/reset_priorities" batches = self.api.post_request(endpoint) return [StudioBatch(batch, self) for batch in batches] + + + def update_ontology( + self, + project_name: str, + project_ontology: List[Union[str, object]], + ontology_name: str, + ) -> Project: + """You can set ontologies on a project. + Ontologies will be referenced by the tasks of a project. + Projects keep a history of the ontologies they were set with. + The ontology can be composed of a list of strings or OntologyChoice objects. + Ontology choices and their subchoices must be unique throughout the ontology. + https://docs.scale.com/reference#project-update-ontology + + Args: + project_name (str): + Project's name. + + ontology (List[Union[str, object]]): + A list of strings or OntologyChoice objects to be set. + + name (str): + Name identifying the version of the ontology. + Returns: + Project + """ + + endpoint = f"projects/{Api.quote_string(project_name)}/setOntology" + payload = dict( + ontology=project_ontology, + name=ontology_name, + ) + projectdata = self.api.post_request(endpoint, body=payload) + return Project(projectdata, self) + + def test_list_quality_labelers( + self, + quality_task_ids: Optional[List[str]] = None, + labeler_emails: Optional[List[str]] = None, + next_token: Optional[str] = None, + limit: Optional[int] = None, + ) -> Tasklist: + """Returns a list of tasks filtered by quality task IDs, labeler emails, and limit. + Returns up to the specified limit at a time, to get more, use the next_token param passed back. + + Args: + quality_task_ids (List[str], optional): + List of quality task IDs to filter tasks by. + + labeler_emails (List[str], optional): + List of labeler email addresses to filter tasks by. + + next_token (str, optional): + Can be used to fetch the next page of tasks. + + limit (int, optional): + Determines the page size (1-100). + + Returns: + Tasklist: A list of tasks that match the provided filters. + """ + params = {} + + if quality_task_ids: + params["quality_task_ids"] = ",".join(quality_task_ids) + + if labeler_emails: + params["labeler_emails"] = ",".join(labeler_emails) + + if next_token: + params["next_token"] = next_token + + if limit: + params["limit"] = limit + + response = self.api.get_request("tasks", params=params) + + docs = [Task(json, self) for json in response["docs"]] + return Tasklist( + docs, + response["total"], + response["limit"], + response["offset"], + response["has_more"], + response.get("next_token"), + ) \ No newline at end of file diff --git a/scaleapi/_version.py b/scaleapi/_version.py index 1860cc4..89429b5 100644 --- a/scaleapi/_version.py +++ b/scaleapi/_version.py @@ -1,2 +1,2 @@ -__version__ = "2.13.0" +__version__ = "2.14.0" __package_name__ = "scaleapi" diff --git a/tests/t_studio.py b/tests/t_studio.py index 9f25189..858316a 100644 --- a/tests/t_studio.py +++ b/tests/t_studio.py @@ -100,4 +100,4 @@ reset_studio_batch_prioprity = client.reset_studio_batches_priorities() print("Test reset studio batch priority") -print(reset_studio_batch_prioprity) +print(reset_studio_batch_prioprity) \ No newline at end of file diff --git a/tests/test_client.py b/tests/test_client.py index 63d4c67..0c6b37e 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -509,3 +509,8 @@ def test_list_studio_batches(): # Check that the batch is returned by the list_studio_batches method batches = client.list_studio_batches() assert len(batches) > 0 + +def test_list_quality_labelers(): + quality_labelers = client.list_quality_labelers() + assert isinstance(quality_labelers, dict) + assert "quality_labelers" in quality_labelers From 76f09d671c12c0c57ed551e886895671d3fb3927 Mon Sep 17 00:00:00 2001 From: Lautaro Rangil Date: Wed, 22 Mar 2023 18:10:32 -0300 Subject: [PATCH 02/17] v2.14.0.1 --- README.rst | 2 +- scaleapi/__init__.py | 103 +++++++++++-------------------------------- 2 files changed, 26 insertions(+), 79 deletions(-) diff --git a/README.rst b/README.rst index 1b0f02c..87e0baa 100644 --- a/README.rst +++ b/README.rst @@ -550,7 +550,7 @@ __ https://docs.scale.com/reference#project-update-ontology ], ontology_name="test_ontology", ) - + Files ________ diff --git a/scaleapi/__init__.py b/scaleapi/__init__.py index 16c1bca..5701902 100644 --- a/scaleapi/__init__.py +++ b/scaleapi/__init__.py @@ -1246,89 +1246,36 @@ def reset_studio_batches_priorities(self) -> List[StudioBatch]: batches = self.api.post_request(endpoint) return [StudioBatch(batch, self) for batch in batches] - def update_ontology( - self, - project_name: str, - project_ontology: List[Union[str, object]], - ontology_name: str, - ) -> Project: - """You can set ontologies on a project. - Ontologies will be referenced by the tasks of a project. - Projects keep a history of the ontologies they were set with. - The ontology can be composed of a list of strings or OntologyChoice objects. - Ontology choices and their subchoices must be unique throughout the ontology. - https://docs.scale.com/reference#project-update-ontology - - Args: - project_name (str): - Project's name. - - ontology (List[Union[str, object]]): - A list of strings or OntologyChoice objects to be set. - - name (str): - Name identifying the version of the ontology. - Returns: - Project - """ - - endpoint = f"projects/{Api.quote_string(project_name)}/setOntology" - payload = dict( - ontology=project_ontology, - name=ontology_name, - ) - projectdata = self.api.post_request(endpoint, body=payload) - return Project(projectdata, self) - - def test_list_quality_labelers( self, - quality_task_ids: Optional[List[str]] = None, - labeler_emails: Optional[List[str]] = None, - next_token: Optional[str] = None, - limit: Optional[int] = None, - ) -> Tasklist: - """Returns a list of tasks filtered by quality task IDs, labeler emails, and limit. - Returns up to the specified limit at a time, to get more, use the next_token param passed back. + project_name: str, + project_ontology: List[Union[str, object]], + ontology_name: str, + ) -> Project: + """You can set ontologies on a project. + Ontologies will be referenced by the tasks of a project. + Projects keep a history of the ontologies they were set with. + The ontology can be composed of a list of strings or OntologyChoice objects. + Ontology choices and their subchoices must be unique throughout the ontology. + https://docs.scale.com/reference#project-update-ontology Args: - quality_task_ids (List[str], optional): - List of quality task IDs to filter tasks by. - - labeler_emails (List[str], optional): - List of labeler email addresses to filter tasks by. - - next_token (str, optional): - Can be used to fetch the next page of tasks. - - limit (int, optional): - Determines the page size (1-100). + project_name (str): + Project's name. + + ontology (List[Union[str, object]]): + A list of strings or OntologyChoice objects to be set. + name (str): + Name identifying the version of the ontology. Returns: - Tasklist: A list of tasks that match the provided filters. + Project """ - params = {} - - if quality_task_ids: - params["quality_task_ids"] = ",".join(quality_task_ids) - - if labeler_emails: - params["labeler_emails"] = ",".join(labeler_emails) - - if next_token: - params["next_token"] = next_token - - if limit: - params["limit"] = limit - response = self.api.get_request("tasks", params=params) - - docs = [Task(json, self) for json in response["docs"]] - return Tasklist( - docs, - response["total"], - response["limit"], - response["offset"], - response["has_more"], - response.get("next_token"), - ) \ No newline at end of file + endpoint = f"projects/{Api.quote_string(project_name)}/setOntology" + payload = dict( + ontology=project_ontology, + name=ontology_name, + ) + projectdata = self.api.post_request(endpoint, body=payload) + return Project(projectdata, self) \ No newline at end of file From ff632f1e7856797540be7351054817242771a2e7 Mon Sep 17 00:00:00 2001 From: Lautaro Rangil Date: Wed, 22 Mar 2023 18:15:08 -0300 Subject: [PATCH 03/17] v2.14.0.2 --- scaleapi/__init__.py | 2 +- tests/t_studio.py | 2 +- tests/test_client.py | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/scaleapi/__init__.py b/scaleapi/__init__.py index 5701902..b93d721 100644 --- a/scaleapi/__init__.py +++ b/scaleapi/__init__.py @@ -1278,4 +1278,4 @@ def update_ontology( name=ontology_name, ) projectdata = self.api.post_request(endpoint, body=payload) - return Project(projectdata, self) \ No newline at end of file + return Project(projectdata, self) diff --git a/tests/t_studio.py b/tests/t_studio.py index 858316a..9f25189 100644 --- a/tests/t_studio.py +++ b/tests/t_studio.py @@ -100,4 +100,4 @@ reset_studio_batch_prioprity = client.reset_studio_batches_priorities() print("Test reset studio batch priority") -print(reset_studio_batch_prioprity) \ No newline at end of file +print(reset_studio_batch_prioprity) diff --git a/tests/test_client.py b/tests/test_client.py index 0c6b37e..fffe2cb 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -510,6 +510,7 @@ def test_list_studio_batches(): batches = client.list_studio_batches() assert len(batches) > 0 + def test_list_quality_labelers(): quality_labelers = client.list_quality_labelers() assert isinstance(quality_labelers, dict) From 912eb48e494b8d4d9d8a1e58662cfe997de44c35 Mon Sep 17 00:00:00 2001 From: Lautaro Rangil Date: Wed, 22 Mar 2023 18:19:18 -0300 Subject: [PATCH 04/17] v2.14.0.3 --- scaleapi/__init__.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scaleapi/__init__.py b/scaleapi/__init__.py index b93d721..08e399c 100644 --- a/scaleapi/__init__.py +++ b/scaleapi/__init__.py @@ -1,4 +1,4 @@ -from typing import IO, Dict, Generator, Generic, List, Optional, TypeVar, Union +from typing import IO, Dict, Generator, Generic, List, TypeVar, Union from scaleapi.batches import Batch, BatchStatus from scaleapi.evaluation_tasks import EvaluationTask @@ -1255,8 +1255,8 @@ def update_ontology( """You can set ontologies on a project. Ontologies will be referenced by the tasks of a project. Projects keep a history of the ontologies they were set with. - The ontology can be composed of a list of strings or OntologyChoice objects. - Ontology choices and their subchoices must be unique throughout the ontology. + The ontology can be a list of strings or objects. + choices and their subchoices must be unique throughout the ontology. https://docs.scale.com/reference#project-update-ontology Args: @@ -1279,3 +1279,4 @@ def update_ontology( ) projectdata = self.api.post_request(endpoint, body=payload) return Project(projectdata, self) + From 174b3d7b861f1a643a12f933b9eb2ff99dcc2318 Mon Sep 17 00:00:00 2001 From: Lautaro Rangil Date: Wed, 22 Mar 2023 18:20:37 -0300 Subject: [PATCH 05/17] v2.14.0.3 --- scaleapi/__init__.py | 1 - 1 file changed, 1 deletion(-) diff --git a/scaleapi/__init__.py b/scaleapi/__init__.py index 08e399c..1389628 100644 --- a/scaleapi/__init__.py +++ b/scaleapi/__init__.py @@ -1279,4 +1279,3 @@ def update_ontology( ) projectdata = self.api.post_request(endpoint, body=payload) return Project(projectdata, self) - From 73325fc80db0080d600ac76a1e6ac069b0b752d3 Mon Sep 17 00:00:00 2001 From: Lautaro Rangil Date: Wed, 22 Mar 2023 18:22:05 -0300 Subject: [PATCH 06/17] v2.14.0.5 --- scaleapi/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scaleapi/__init__.py b/scaleapi/__init__.py index 1389628..144a160 100644 --- a/scaleapi/__init__.py +++ b/scaleapi/__init__.py @@ -1256,7 +1256,7 @@ def update_ontology( Ontologies will be referenced by the tasks of a project. Projects keep a history of the ontologies they were set with. The ontology can be a list of strings or objects. - choices and their subchoices must be unique throughout the ontology. + choices and their subchoices must be unique throughout the. https://docs.scale.com/reference#project-update-ontology Args: From 09d729a53ec7f7ae7ba0b6fca58b7e840db7c0a7 Mon Sep 17 00:00:00 2001 From: Lautaro Rangil Date: Wed, 22 Mar 2023 18:25:22 -0300 Subject: [PATCH 07/17] v2.14.0.6 --- tests/test_client.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tests/test_client.py b/tests/test_client.py index fffe2cb..63d4c67 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -509,9 +509,3 @@ def test_list_studio_batches(): # Check that the batch is returned by the list_studio_batches method batches = client.list_studio_batches() assert len(batches) > 0 - - -def test_list_quality_labelers(): - quality_labelers = client.list_quality_labelers() - assert isinstance(quality_labelers, dict) - assert "quality_labelers" in quality_labelers From e7d3cdf10992e84afe21c593416cd8baf247153f Mon Sep 17 00:00:00 2001 From: Lautaro Rangil Date: Wed, 22 Mar 2023 22:09:39 -0300 Subject: [PATCH 08/17] v2.14.0.7 --- README.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 87e0baa..51cf8e3 100644 --- a/README.rst +++ b/README.rst @@ -534,7 +534,7 @@ __ https://docs.scale.com/reference#project-update-parameters ) Update Ontology -^^^^^^^^^^^^^^ +^^^^^^^^^^^^^^^ Creates a new version of the Project Ontology. Check out `Scale's API documentation`__ for more information. __ https://docs.scale.com/reference#project-update-ontology .. code-block :: python @@ -550,7 +550,7 @@ __ https://docs.scale.com/reference#project-update-ontology ], ontology_name="test_ontology", ) - + Files ________ From a1f30d6ea6b8cde42ac3e5015f3d050519e4a411 Mon Sep 17 00:00:00 2001 From: Lautaro Rangil Date: Wed, 22 Mar 2023 22:13:47 -0300 Subject: [PATCH 09/17] v2.14.0.8 --- README.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.rst b/README.rst index 51cf8e3..dab6961 100644 --- a/README.rst +++ b/README.rst @@ -537,7 +537,9 @@ Update Ontology ^^^^^^^^^^^^^^^ Creates a new version of the Project Ontology. Check out `Scale's API documentation`__ for more information. __ https://docs.scale.com/reference#project-update-ontology + .. code-block :: python + data = client.update_ontology( project_name="test_project", project_ontology=[ From c8583532d5059494f6da0388d1803afd02e7aaec Mon Sep 17 00:00:00 2001 From: Lautaro Rangil Date: Wed, 22 Mar 2023 22:21:03 -0300 Subject: [PATCH 10/17] v2.14.0.8 --- README.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index dab6961..4b7ea2e 100644 --- a/README.rst +++ b/README.rst @@ -536,10 +536,11 @@ __ https://docs.scale.com/reference#project-update-parameters Update Ontology ^^^^^^^^^^^^^^^ Creates a new version of the Project Ontology. Check out `Scale's API documentation`__ for more information. + __ https://docs.scale.com/reference#project-update-ontology .. code-block :: python - + data = client.update_ontology( project_name="test_project", project_ontology=[ From 8dbc7be796d202c5864f52ba36cb31de10035aa9 Mon Sep 17 00:00:00 2001 From: Lautaro Rangil Date: Thu, 23 Mar 2023 00:22:42 -0300 Subject: [PATCH 11/17] v2.14.0.9 --- scaleapi/__init__.py | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/scaleapi/__init__.py b/scaleapi/__init__.py index 144a160..d6831f8 100644 --- a/scaleapi/__init__.py +++ b/scaleapi/__init__.py @@ -1,4 +1,4 @@ -from typing import IO, Dict, Generator, Generic, List, TypeVar, Union +from typing import IO, Dict, Generator, Generic, List, Optional, Any, TypeVar, Union from scaleapi.batches import Batch, BatchStatus from scaleapi.evaluation_tasks import EvaluationTask @@ -1279,3 +1279,37 @@ def update_ontology( ) projectdata = self.api.post_request(endpoint, body=payload) return Project(projectdata, self) + + def get_labeler_attempts( + self, + quality_task_ids: Optional[List[str]] = None, + labeler_emails: Optional[List[str]] = None, + next_token: Optional[str] = None, + limit: Optional[int] = None) -> Dict[str, Any]: + """Retrieves a list of training attempts by labelers. + + Args: + quality_task_ids (Optional[List[str]]): + An array of training scenario IDs that the returned training attempts. + labeler_emails (Optional[List[str]]): + An array of email addresses of the labelers who completed the training attempts. + next_token (Optional[str]): + A token used to retrieve the next page of results if there are more. + limit (Optional[int]): + Number of Training Attempts to return per request. + + Returns: + Dict[str, Any]: + A dict containing a list of training attempts matching labeler. + """ + endpoint = "quality/labelers" + params = {} + if quality_task_ids: + params["quality_task_ids"] = quality_task_ids + if labeler_emails: + params["labeler_emails"] = labeler_emails + if next_token: + params["next_token"] = next_token + if limit: + params["limit"] = limit + return self.get_request(endpoint, params=params) \ No newline at end of file From e0944dfcdedd1b56ae81c270757ea8a365a73f9e Mon Sep 17 00:00:00 2001 From: Lautaro Rangil Date: Thu, 23 Mar 2023 00:24:09 -0300 Subject: [PATCH 12/17] v2.14.0.1.0 --- scaleapi/__init__.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/scaleapi/__init__.py b/scaleapi/__init__.py index d6831f8..c7a5b2c 100644 --- a/scaleapi/__init__.py +++ b/scaleapi/__init__.py @@ -1282,10 +1282,11 @@ def update_ontology( def get_labeler_attempts( self, - quality_task_ids: Optional[List[str]] = None, - labeler_emails: Optional[List[str]] = None, - next_token: Optional[str] = None, - limit: Optional[int] = None) -> Dict[str, Any]: + quality_task_ids: Optional[List[str]] = None, + labeler_emails: Optional[List[str]] = None, + next_token: Optional[str] = None, + limit: Optional[int] = None, + ) -> Dict[str, Any]: """Retrieves a list of training attempts by labelers. Args: @@ -1312,4 +1313,4 @@ def get_labeler_attempts( params["next_token"] = next_token if limit: params["limit"] = limit - return self.get_request(endpoint, params=params) \ No newline at end of file + return self.get_request(endpoint, params=params) From a1449b44983f8e9eac171cc0d5698e3758e59f24 Mon Sep 17 00:00:00 2001 From: Lautaro Rangil Date: Thu, 23 Mar 2023 00:29:25 -0300 Subject: [PATCH 13/17] v2.14.0.1.1 --- scaleapi/__init__.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/scaleapi/__init__.py b/scaleapi/__init__.py index c7a5b2c..f2e9d37 100644 --- a/scaleapi/__init__.py +++ b/scaleapi/__init__.py @@ -1,4 +1,4 @@ -from typing import IO, Dict, Generator, Generic, List, Optional, Any, TypeVar, Union +from typing import IO, Dict, Generator, Generic, List, TypeVar, Union from scaleapi.batches import Batch, BatchStatus from scaleapi.evaluation_tasks import EvaluationTask @@ -1282,25 +1282,25 @@ def update_ontology( def get_labeler_attempts( self, - quality_task_ids: Optional[List[str]] = None, - labeler_emails: Optional[List[str]] = None, - next_token: Optional[str] = None, - limit: Optional[int] = None, - ) -> Dict[str, Any]: + quality_task_ids: List[str] = [], + labeler_emails: List[str] = [], + next_token: str = "", + limit: int = 0, + ) -> Dict[str, Union[str, List[str]]]: """Retrieves a list of training attempts by labelers. Args: - quality_task_ids (Optional[List[str]]): + quality_task_ids (List[str]): An array of training scenario IDs that the returned training attempts. - labeler_emails (Optional[List[str]]): + labeler_emails (List[str]): An array of email addresses of the labelers who completed the training attempts. - next_token (Optional[str]): + next_token (str): A token used to retrieve the next page of results if there are more. - limit (Optional[int]): + limit (int): Number of Training Attempts to return per request. Returns: - Dict[str, Any]: + Dict[str, Union[str, List[str]]]: A dict containing a list of training attempts matching labeler. """ endpoint = "quality/labelers" From a929c2fbb062c4b886abdf2557b9949090b0d5fb Mon Sep 17 00:00:00 2001 From: Lautaro Rangil Date: Thu, 23 Mar 2023 00:34:15 -0300 Subject: [PATCH 14/17] v2.14.0.1.2 --- scaleapi/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scaleapi/__init__.py b/scaleapi/__init__.py index f2e9d37..12f0e71 100644 --- a/scaleapi/__init__.py +++ b/scaleapi/__init__.py @@ -1291,17 +1291,17 @@ def get_labeler_attempts( Args: quality_task_ids (List[str]): - An array of training scenario IDs that the returned training attempts. + arr of training scenario IDs returned training att. labeler_emails (List[str]): - An array of email addresses of the labelers who completed the training attempts. + arr of email of the lblrs who completed training att. next_token (str): - A token used to retrieve the next page of results if there are more. + tokn to retrieve next page of results if there are more. limit (int): Number of Training Attempts to return per request. Returns: Dict[str, Union[str, List[str]]]: - A dict containing a list of training attempts matching labeler. + A dict of list of training att matching labeler. """ endpoint = "quality/labelers" params = {} From 7aacafb90722a1434cd7c9217a571ec26c5ce3ee Mon Sep 17 00:00:00 2001 From: Lautaro Rangil Date: Thu, 23 Mar 2023 00:36:19 -0300 Subject: [PATCH 15/17] v2.14.0.1.3 --- scaleapi/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scaleapi/__init__.py b/scaleapi/__init__.py index 12f0e71..7d4711c 100644 --- a/scaleapi/__init__.py +++ b/scaleapi/__init__.py @@ -1282,8 +1282,8 @@ def update_ontology( def get_labeler_attempts( self, - quality_task_ids: List[str] = [], - labeler_emails: List[str] = [], + quality_task_ids: List[str] = None, + labeler_emails: List[str] = None, next_token: str = "", limit: int = 0, ) -> Dict[str, Union[str, List[str]]]: @@ -1313,4 +1313,4 @@ def get_labeler_attempts( params["next_token"] = next_token if limit: params["limit"] = limit - return self.get_request(endpoint, params=params) + return self.api.get_request(endpoint, params=params) From 6865e55ba5380e3969dfb2faae7205409ed488aa Mon Sep 17 00:00:00 2001 From: Lautaro Rangil Date: Thu, 23 Mar 2023 11:09:37 -0300 Subject: [PATCH 16/17] v2.14.0.1.4 --- README.rst | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.rst b/README.rst index 4b7ea2e..fa460f7 100644 --- a/README.rst +++ b/README.rst @@ -899,6 +899,20 @@ Returns a List of StudioBatch objects in the new order. reset_studio_batch_prioprity = client.reset_studio_batches_priorities() +Grt Labeler Training Attempts +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Retrieves a list of training attempts by labelers. + +.. code-block:: python + + client.get_labeler_attempts( + quality_task_ids: List[str] = None, + labeler_emails: List[str] = None, + next_token: str = "", + limit: int = 0, + ) -> Dict[str, Union[str, List[str]]]: + Error handling ______________ From a66bf51c3810e18d2c3274f6acb4bceaa26113f5 Mon Sep 17 00:00:00 2001 From: Lautaro Rangil Date: Thu, 23 Mar 2023 12:37:51 -0300 Subject: [PATCH 17/17] v2.14.0.1.5 --- README.rst | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/README.rst b/README.rst index fa460f7..2cb2575 100644 --- a/README.rst +++ b/README.rst @@ -760,7 +760,7 @@ Retrieves a list of training attempts by labelers. .. code-block:: python - client.list_training_attempts( + client.get_labeler_attempts( quality_task_ids: Optional[List[str]] = None, labeler_emails: Optional[List[str]] = None, next_token: Optional[str] = None, @@ -899,21 +899,6 @@ Returns a List of StudioBatch objects in the new order. reset_studio_batch_prioprity = client.reset_studio_batches_priorities() -Grt Labeler Training Attempts -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -Retrieves a list of training attempts by labelers. - -.. code-block:: python - - client.get_labeler_attempts( - quality_task_ids: List[str] = None, - labeler_emails: List[str] = None, - next_token: str = "", - limit: int = 0, - ) -> Dict[str, Union[str, List[str]]]: - - Error handling ______________