Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: LEAP-1833: Pause limits settings for project #419

Merged
merged 4 commits into from
Feb 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .mock/definition/__package__.yml
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,16 @@ types:
Maximum number of annotations for one task. If the number of
annotations per task is equal or greater to this value, the task is
completed (is_labeled=True)
annotation_limit_count:
type: optional<integer>
docs: >-
Maximum number of tasks that can be annotated by a single annotator in
this project pause
annotation_limit_percent:
type: optional<float>
docs: >-
Maximum percentage of tasks in this project that can be annotated by a
single annotator
is_published:
type: optional<boolean>
docs: Whether or not the project is published to annotators
Expand Down
12 changes: 12 additions & 0 deletions .mock/definition/projects.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@ types:
maximum_annotations:
type: optional<integer>
docs: Maximum annotations per task
annotation_limit_count:
type: optional<integer>
docs: Maximum number of annotations per annotator
annotation_limit_percent:
type: optional<float>
docs: Maximum percentage of annotations per annotator
color:
type: optional<string>
docs: Project color in HEX format
Expand Down Expand Up @@ -243,6 +249,8 @@ service:
- output_classes
color: color
maximum_annotations: 1
annotation_limit_count: 1
annotation_limit_percent: 1.1
is_published: true
model_version: model_version
is_draft: true
Expand Down Expand Up @@ -462,6 +470,8 @@ service:
skill_name: skill_name
color: '#FF0000'
maximum_annotations: 1
annotation_limit_count: 10
annotation_limit_percent: 50
is_published: true
model_version: 1.0.0
is_draft: false
Expand Down Expand Up @@ -652,6 +662,8 @@ service:
reveal_preannotations_interactively: true
show_collab_predictions: true
maximum_annotations: 1
annotation_limit_count: 1
annotation_limit_percent: 1.1
color: color
control_weights:
my_bbox:
Expand Down
19 changes: 19 additions & 0 deletions .mock/openapi/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2497,6 +2497,8 @@ paths:
finished_task_number: 10
queue_total: 10
queue_done: 100
annotation_limit_count: 10
annotation_limit_percent: 50
tags:
- Projects
x-fern-sdk-group-name: projects
Expand Down Expand Up @@ -2569,6 +2571,14 @@ paths:
title: maximum_annotations
description: Maximum annotations per task
type: integer
annotation_limit_count:
title: annotation_limit_count
description: Maximum number of annotations per annotator
type: integer
annotation_limit_percent:
title: annotation_limit_percent
description: Maximum percentage of annotations per annotator
type: float
color:
title: color
description: Project color in HEX format
Expand Down Expand Up @@ -8514,6 +8524,15 @@ components:
annotations per task is equal or greater to this value, the task is
completed (is_labeled=True)
type: integer
annotation_limit_count:
title: Annotation limit count
description: Maximum number of tasks that can be annotated by a single annotator in this project
pause
type: integer
annotation_limit_percent:
title: Annotation limit percent
description: Maximum percentage of tasks in this project that can be annotated by a single annotator
type: float
is_published:
title: Published
description: Whether or not the project is published to annotators
Expand Down
6 changes: 3 additions & 3 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions src/label_studio_sdk/projects/types/projects_update_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,16 @@ class ProjectsUpdateResponse(UniversalBaseModel):
Maximum annotations per task
"""

annotation_limit_count: typing.Optional[int] = pydantic.Field(default=None)
"""
Maximum number of annotations per annotator
"""

annotation_limit_percent: typing.Optional[float] = pydantic.Field(default=None)
"""
Maximum percentage of annotations per annotator
"""

color: typing.Optional[str] = pydantic.Field(default=None)
"""
Project color in HEX format
Expand Down
10 changes: 10 additions & 0 deletions src/label_studio_sdk/types/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,16 @@ class Project(UniversalBaseModel):
Maximum number of annotations for one task. If the number of annotations per task is equal or greater to this value, the task is completed (is_labeled=True)
"""

annotation_limit_count: typing.Optional[int] = pydantic.Field(default=None)
"""
Maximum number of tasks that can be annotated by a single annotator in this project pause
"""

annotation_limit_percent: typing.Optional[float] = pydantic.Field(default=None)
"""
Maximum percentage of tasks in this project that can be annotated by a single annotator
"""

is_published: typing.Optional[bool] = pydantic.Field(default=None)
"""
Whether or not the project is published to annotators
Expand Down
8 changes: 8 additions & 0 deletions tests/test_projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ async def test_get(client: LabelStudio, async_client: AsyncLabelStudio) -> None:
],
"color": "#FF0000",
"maximum_annotations": 1,
"annotation_limit_count": 10,
"annotation_limit_percent": 50,
"is_published": True,
"model_version": "1.0.0",
"is_draft": False,
Expand Down Expand Up @@ -144,6 +146,8 @@ async def test_get(client: LabelStudio, async_client: AsyncLabelStudio) -> None:
),
"color": None,
"maximum_annotations": "integer",
"annotation_limit_count": "integer",
"annotation_limit_percent": None,
"is_published": None,
"model_version": None,
"is_draft": None,
Expand Down Expand Up @@ -209,6 +213,8 @@ async def test_update(client: LabelStudio, async_client: AsyncLabelStudio) -> No
"reveal_preannotations_interactively": True,
"show_collab_predictions": True,
"maximum_annotations": 1,
"annotation_limit_count": 1,
"annotation_limit_percent": 1.1,
"color": "color",
"control_weights": {
"my_bbox": {"type": "RectangleLabels", "labels": {"Car": 1, "Airplaine": 0.5}, "overall": 0.33}
Expand All @@ -226,6 +232,8 @@ async def test_update(client: LabelStudio, async_client: AsyncLabelStudio) -> No
"reveal_preannotations_interactively": None,
"show_collab_predictions": None,
"maximum_annotations": "integer",
"annotation_limit_count": "integer",
"annotation_limit_percent": None,
"color": None,
"control_weights": ("dict", {0: (None, None)}),
}
Expand Down
Loading