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.
Files changed (45) hide show
  1. {unitlab-3.1.1 → unitlab-3.1.2}/PKG-INFO +1 -1
  2. {unitlab-3.1.1 → unitlab-3.1.2}/pyproject.toml +1 -1
  3. {unitlab-3.1.1 → unitlab-3.1.2}/src/unitlab/resources/releases.py +20 -0
  4. {unitlab-3.1.1 → unitlab-3.1.2}/.gitignore +0 -0
  5. {unitlab-3.1.1 → unitlab-3.1.2}/LICENSE.md +0 -0
  6. {unitlab-3.1.1 → unitlab-3.1.2}/README.md +0 -0
  7. {unitlab-3.1.1 → unitlab-3.1.2}/src/unitlab/__init__.py +0 -0
  8. {unitlab-3.1.1 → unitlab-3.1.2}/src/unitlab/__main__.py +0 -0
  9. {unitlab-3.1.1 → unitlab-3.1.2}/src/unitlab/_config.py +0 -0
  10. {unitlab-3.1.1 → unitlab-3.1.2}/src/unitlab/_downloader.py +0 -0
  11. {unitlab-3.1.1 → unitlab-3.1.2}/src/unitlab/_grouping.py +0 -0
  12. {unitlab-3.1.1 → unitlab-3.1.2}/src/unitlab/_http.py +0 -0
  13. {unitlab-3.1.1 → unitlab-3.1.2}/src/unitlab/_nuscenes.py +0 -0
  14. {unitlab-3.1.1 → unitlab-3.1.2}/src/unitlab/_scene_uploader.py +0 -0
  15. {unitlab-3.1.1 → unitlab-3.1.2}/src/unitlab/_scenes.py +0 -0
  16. {unitlab-3.1.1 → unitlab-3.1.2}/src/unitlab/_uploader.py +0 -0
  17. {unitlab-3.1.1 → unitlab-3.1.2}/src/unitlab/_waiter.py +0 -0
  18. {unitlab-3.1.1 → unitlab-3.1.2}/src/unitlab/cli.py +0 -0
  19. {unitlab-3.1.1 → unitlab-3.1.2}/src/unitlab/client.py +0 -0
  20. {unitlab-3.1.1 → unitlab-3.1.2}/src/unitlab/exceptions.py +0 -0
  21. {unitlab-3.1.1 → unitlab-3.1.2}/src/unitlab/ontology.py +0 -0
  22. {unitlab-3.1.1 → unitlab-3.1.2}/src/unitlab/py.typed +0 -0
  23. {unitlab-3.1.1 → unitlab-3.1.2}/src/unitlab/resources/__init__.py +0 -0
  24. {unitlab-3.1.1 → unitlab-3.1.2}/src/unitlab/resources/_base.py +0 -0
  25. {unitlab-3.1.1 → unitlab-3.1.2}/src/unitlab/resources/annotation_imports.py +0 -0
  26. {unitlab-3.1.1 → unitlab-3.1.2}/src/unitlab/resources/assets.py +0 -0
  27. {unitlab-3.1.1 → unitlab-3.1.2}/src/unitlab/resources/cloud.py +0 -0
  28. {unitlab-3.1.1 → unitlab-3.1.2}/src/unitlab/resources/datasets.py +0 -0
  29. {unitlab-3.1.1 → unitlab-3.1.2}/src/unitlab/resources/embeddings.py +0 -0
  30. {unitlab-3.1.1 → unitlab-3.1.2}/src/unitlab/resources/ontologies.py +0 -0
  31. {unitlab-3.1.1 → unitlab-3.1.2}/src/unitlab/resources/projects.py +0 -0
  32. {unitlab-3.1.1 → unitlab-3.1.2}/src/unitlab/resources/workflow.py +0 -0
  33. {unitlab-3.1.1 → unitlab-3.1.2}/src/unitlab/types.py +0 -0
  34. {unitlab-3.1.1 → unitlab-3.1.2}/tests/test_annotation_imports.py +0 -0
  35. {unitlab-3.1.1 → unitlab-3.1.2}/tests/test_cli.py +0 -0
  36. {unitlab-3.1.1 → unitlab-3.1.2}/tests/test_client.py +0 -0
  37. {unitlab-3.1.1 → unitlab-3.1.2}/tests/test_downloader.py +0 -0
  38. {unitlab-3.1.1 → unitlab-3.1.2}/tests/test_embeddings.py +0 -0
  39. {unitlab-3.1.1 → unitlab-3.1.2}/tests/test_http.py +0 -0
  40. {unitlab-3.1.1 → unitlab-3.1.2}/tests/test_nuscenes.py +0 -0
  41. {unitlab-3.1.1 → unitlab-3.1.2}/tests/test_scene_cli.py +0 -0
  42. {unitlab-3.1.1 → unitlab-3.1.2}/tests/test_scene_uploads.py +0 -0
  43. {unitlab-3.1.1 → unitlab-3.1.2}/tests/test_scenes.py +0 -0
  44. {unitlab-3.1.1 → unitlab-3.1.2}/tests/test_tiled_uploads.py +0 -0
  45. {unitlab-3.1.1 → unitlab-3.1.2}/tests/test_uploader.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: unitlab
3
- Version: 3.1.1
3
+ Version: 3.1.2
4
4
  Summary: Python SDK for the Unitlab.ai data annotation platform
5
5
  Project-URL: Homepage, https://unitlab.ai
6
6
  Project-URL: Documentation, https://docs.unitlab.ai
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "unitlab"
7
- version = "3.1.1"
7
+ version = "3.1.2"
8
8
  description = "Python SDK for the Unitlab.ai data annotation platform"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -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