unitlab 3.1.1__tar.gz → 3.1.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {unitlab-3.1.1 → unitlab-3.1.2}/PKG-INFO +1 -1
- {unitlab-3.1.1 → unitlab-3.1.2}/pyproject.toml +1 -1
- {unitlab-3.1.1 → unitlab-3.1.2}/src/unitlab/resources/releases.py +20 -0
- {unitlab-3.1.1 → unitlab-3.1.2}/.gitignore +0 -0
- {unitlab-3.1.1 → unitlab-3.1.2}/LICENSE.md +0 -0
- {unitlab-3.1.1 → unitlab-3.1.2}/README.md +0 -0
- {unitlab-3.1.1 → unitlab-3.1.2}/src/unitlab/__init__.py +0 -0
- {unitlab-3.1.1 → unitlab-3.1.2}/src/unitlab/__main__.py +0 -0
- {unitlab-3.1.1 → unitlab-3.1.2}/src/unitlab/_config.py +0 -0
- {unitlab-3.1.1 → unitlab-3.1.2}/src/unitlab/_downloader.py +0 -0
- {unitlab-3.1.1 → unitlab-3.1.2}/src/unitlab/_grouping.py +0 -0
- {unitlab-3.1.1 → unitlab-3.1.2}/src/unitlab/_http.py +0 -0
- {unitlab-3.1.1 → unitlab-3.1.2}/src/unitlab/_nuscenes.py +0 -0
- {unitlab-3.1.1 → unitlab-3.1.2}/src/unitlab/_scene_uploader.py +0 -0
- {unitlab-3.1.1 → unitlab-3.1.2}/src/unitlab/_scenes.py +0 -0
- {unitlab-3.1.1 → unitlab-3.1.2}/src/unitlab/_uploader.py +0 -0
- {unitlab-3.1.1 → unitlab-3.1.2}/src/unitlab/_waiter.py +0 -0
- {unitlab-3.1.1 → unitlab-3.1.2}/src/unitlab/cli.py +0 -0
- {unitlab-3.1.1 → unitlab-3.1.2}/src/unitlab/client.py +0 -0
- {unitlab-3.1.1 → unitlab-3.1.2}/src/unitlab/exceptions.py +0 -0
- {unitlab-3.1.1 → unitlab-3.1.2}/src/unitlab/ontology.py +0 -0
- {unitlab-3.1.1 → unitlab-3.1.2}/src/unitlab/py.typed +0 -0
- {unitlab-3.1.1 → unitlab-3.1.2}/src/unitlab/resources/__init__.py +0 -0
- {unitlab-3.1.1 → unitlab-3.1.2}/src/unitlab/resources/_base.py +0 -0
- {unitlab-3.1.1 → unitlab-3.1.2}/src/unitlab/resources/annotation_imports.py +0 -0
- {unitlab-3.1.1 → unitlab-3.1.2}/src/unitlab/resources/assets.py +0 -0
- {unitlab-3.1.1 → unitlab-3.1.2}/src/unitlab/resources/cloud.py +0 -0
- {unitlab-3.1.1 → unitlab-3.1.2}/src/unitlab/resources/datasets.py +0 -0
- {unitlab-3.1.1 → unitlab-3.1.2}/src/unitlab/resources/embeddings.py +0 -0
- {unitlab-3.1.1 → unitlab-3.1.2}/src/unitlab/resources/ontologies.py +0 -0
- {unitlab-3.1.1 → unitlab-3.1.2}/src/unitlab/resources/projects.py +0 -0
- {unitlab-3.1.1 → unitlab-3.1.2}/src/unitlab/resources/workflow.py +0 -0
- {unitlab-3.1.1 → unitlab-3.1.2}/src/unitlab/types.py +0 -0
- {unitlab-3.1.1 → unitlab-3.1.2}/tests/test_annotation_imports.py +0 -0
- {unitlab-3.1.1 → unitlab-3.1.2}/tests/test_cli.py +0 -0
- {unitlab-3.1.1 → unitlab-3.1.2}/tests/test_client.py +0 -0
- {unitlab-3.1.1 → unitlab-3.1.2}/tests/test_downloader.py +0 -0
- {unitlab-3.1.1 → unitlab-3.1.2}/tests/test_embeddings.py +0 -0
- {unitlab-3.1.1 → unitlab-3.1.2}/tests/test_http.py +0 -0
- {unitlab-3.1.1 → unitlab-3.1.2}/tests/test_nuscenes.py +0 -0
- {unitlab-3.1.1 → unitlab-3.1.2}/tests/test_scene_cli.py +0 -0
- {unitlab-3.1.1 → unitlab-3.1.2}/tests/test_scene_uploads.py +0 -0
- {unitlab-3.1.1 → unitlab-3.1.2}/tests/test_scenes.py +0 -0
- {unitlab-3.1.1 → unitlab-3.1.2}/tests/test_tiled_uploads.py +0 -0
- {unitlab-3.1.1 → unitlab-3.1.2}/tests/test_uploader.py +0 -0
|
@@ -35,6 +35,7 @@ class ReleasesNamespace(Namespace):
|
|
|
35
35
|
data_types=None,
|
|
36
36
|
bundle_formats: dict[str, str] | None = None,
|
|
37
37
|
license_id: str | None = None,
|
|
38
|
+
completed_only: bool = False,
|
|
38
39
|
wait: bool = True,
|
|
39
40
|
timeout: float = 7200,
|
|
40
41
|
) -> Release:
|
|
@@ -61,6 +62,11 @@ class ReleasesNamespace(Namespace):
|
|
|
61
62
|
includes every available concrete type.
|
|
62
63
|
bundle_formats: Per-concrete-data-type formats for multimodal bundles.
|
|
63
64
|
license_id: Optional Dataset license ID.
|
|
65
|
+
completed_only: Only items whose current workflow status is
|
|
66
|
+
Complete (a Data Group by its own status), with their latest
|
|
67
|
+
labels. Raises ``UnitlabError`` (code
|
|
68
|
+
``completed_only_unsupported``) if the server does not know the
|
|
69
|
+
option, instead of returning a Release of every item.
|
|
64
70
|
wait: Block until the Release is ready or has failed.
|
|
65
71
|
timeout: Seconds to wait for preparation when ``wait`` is true.
|
|
66
72
|
|
|
@@ -98,6 +104,9 @@ class ReleasesNamespace(Namespace):
|
|
|
98
104
|
}
|
|
99
105
|
if license_id is not None:
|
|
100
106
|
payload["license"] = identifier(license_id)
|
|
107
|
+
if completed_only:
|
|
108
|
+
# Sent only when asked, so every other request body stays as before.
|
|
109
|
+
payload["completed_only"] = True
|
|
101
110
|
# The long request timeout stays: a backend that predates background
|
|
102
111
|
# preparation still builds the whole Release inside this POST.
|
|
103
112
|
raw = self._api.post(
|
|
@@ -106,6 +115,14 @@ class ReleasesNamespace(Namespace):
|
|
|
106
115
|
timeout=600.0,
|
|
107
116
|
)
|
|
108
117
|
release = Release._from_raw(self._client, raw)
|
|
118
|
+
if completed_only and not release.completed_only:
|
|
119
|
+
# An older server drops the unknown field and releases every item;
|
|
120
|
+
# its answer then lacks the echo. Say so rather than hand that back.
|
|
121
|
+
raise UnitlabError(
|
|
122
|
+
"This Unitlab server does not support completed_only releases; "
|
|
123
|
+
f"Release {release.id} was created with every labelled item.",
|
|
124
|
+
code="completed_only_unsupported",
|
|
125
|
+
)
|
|
109
126
|
return release.wait(timeout=timeout) if wait else release
|
|
110
127
|
|
|
111
128
|
|
|
@@ -124,6 +141,8 @@ class Release:
|
|
|
124
141
|
status: str | None = None
|
|
125
142
|
progress: int | None = None
|
|
126
143
|
status_error: str | None = None
|
|
144
|
+
# True when the Release holds only items that were Complete.
|
|
145
|
+
completed_only: bool = False
|
|
127
146
|
|
|
128
147
|
@classmethod
|
|
129
148
|
def _from_raw(cls, client: UnitlabClient, raw: dict[str, Any]) -> Release:
|
|
@@ -140,6 +159,7 @@ class Release:
|
|
|
140
159
|
status=raw.get("status"),
|
|
141
160
|
progress=raw.get("progress"),
|
|
142
161
|
status_error=raw.get("status_error"),
|
|
162
|
+
completed_only=bool(raw.get("completed_only", False)),
|
|
143
163
|
)
|
|
144
164
|
|
|
145
165
|
def refresh(self) -> Release:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|