-
Notifications
You must be signed in to change notification settings - Fork 68
Modify get_overview to support duplicate names and provide a simplify… #1629
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
Merged
Merged
Changes from 7 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
7ba272c
Modify get_overview to support duplicate names and provide a simplify…
paulnoirel cfe7d0c
Update test
paulnoirel 8ce9e99
fix TypedDict as per tests
paulnoirel 62b24a6
fix test
paulnoirel bca9af2
Merge branch 'develop' into PNO/fix_get_overview
paulnoirel e811ad6
Expose ProjectOverview and ProjectOverviewDetailed
paulnoirel a4fa4fc
Merge branch 'develop' into PNO/fix_get_overview
paulnoirel 700982c
Fixed format and remove nested function
paulnoirel e58438b
Merge branch 'develop' into PNO/fix_get_overview
paulnoirel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,72 @@ | ||
from typing import Dict | ||
from typing import Dict, List | ||
from labelbox.pydantic_compat import BaseModel | ||
|
||
from typing import Dict | ||
from typing_extensions import TypedDict | ||
|
||
class ProjectOverview(BaseModel): | ||
""" | ||
Class that represents a project summary as displayed in the UI, in Annotate, | ||
under the "Overview" tab of a particular project. | ||
|
||
All attributes represent the number of data rows in the corresponding state. | ||
The `in_review` attribute is a dictionary where the keys are the queue names | ||
and the values are the number of data rows in that queue. | ||
The `to_label` attribute represents the number of data rows that are yet to be labeled (To Label). | ||
The `in_review` attribute is a dictionary where the keys are the queue names and the values are the number of data rows in that queue (In Review). | ||
The `in_rework` attribute represents the number of data rows that are in the Rework queue (In Rework). | ||
The `skipped` attribute represents the number of data rows that have been skipped (Skipped). | ||
The `done` attribute represents the number of data rows that have been marked as Done (Done). | ||
The `issues` attribute represents the number of data rows with associated issues (Issues). | ||
|
||
Attributes: | ||
Representing existing fields from the Overview tag (UI names in parentheses): | ||
|
||
to_label (int): The number of data rows that are yet to be labeled (To Label). | ||
in_review (Dict[str, int]): A dictionary where the keys are the queue names . | ||
and the values are the number of data rows in that queue. (In Review) | ||
in_rework (int): The number of data rows that are in the Rework queue (In Rework). | ||
skipped (int): The number of data rows that have been skipped (Skipped). | ||
done (int): The number of data rows that have been marked as Done (Done). | ||
issues (int): The number of data rows with associated issues (Issues). | ||
|
||
Additional values: | ||
|
||
labeled (int): The number of data rows that have been labeled. | ||
all_in_data_rows (int): The total number of data rows in the project. | ||
The following don't appear in the UI | ||
The `labeled` attribute represents the number of data rows that have been labeled. | ||
The `total_data_rows` attribute represents the total number of data rows in the project. | ||
""" | ||
to_label: int | ||
in_review: Dict[str, int] | ||
in_review: int | ||
in_rework: int | ||
skipped: int | ||
done: int | ||
issues: int | ||
labeled: int | ||
all_in_data_rows: int | ||
total_data_rows: int | ||
|
||
|
||
class _QueueDetail(TypedDict): | ||
""" | ||
Class that represents the detailed information of the queues in the project overview. | ||
The `data` attribute is a list of dictionaries where the keys are the queue names | ||
and the values are the number of data rows in that queue. | ||
""" | ||
data: List[Dict[str, int]] | ||
total: int | ||
|
||
|
||
class ProjectOverviewDetailed(BaseModel): | ||
""" | ||
Class that represents a project summary as displayed in the UI, in Annotate, | ||
under the "Overview" tab of a particular project. | ||
This class adds the list of task queues for the `in_review` and `in_rework` attributes. | ||
|
||
All attributes represent the number of data rows in the corresponding state. | ||
The `to_label` attribute represents the number of data rows that are yet to be labeled (To Label). | ||
The `in_review` attribute is a dictionary where the keys are (In Review): | ||
data: a list of dictionaries with the queue name and the number of data rows | ||
total: the total number of data rows in the In Review state | ||
The `in_rework` attribute is a dictionary where the keys are (In Rework): | ||
data: a list of dictionaries with the queue name and the number of data rows | ||
total: the total number of data rows in the In Rework state | ||
The `skipped` attribute represents the number of data rows that have been skipped (Skipped). | ||
The `done` attribute represents the number of data rows that have been marked as Done (Done). | ||
The `issues` attribute represents the number of data rows with associated issues (Issues). | ||
|
||
The following don't appear in the UI | ||
The `labeled` attribute represents the number of data rows that have been labeled. | ||
The `total_data_rows` attribute represents the total number of data rows in the project. | ||
""" | ||
|
||
to_label: int | ||
in_review: _QueueDetail | ||
in_rework: _QueueDetail | ||
skipped: int | ||
done: int | ||
issues: int | ||
labeled: int | ||
total_data_rows: int |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.