rapidata 0.1.14__py3-none-any.whl → 0.1.15__py3-none-any.whl

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.
@@ -1,10 +1,5 @@
1
1
  import time
2
- from rapidata.api_client.models.create_order_model_referee import CreateOrderModelReferee
3
- from rapidata.api_client.models.create_order_model_workflow import CreateOrderModelWorkflow
4
2
  from rapidata.rapidata_client.dataset.rapidata_dataset import RapidataDataset
5
- from rapidata.rapidata_client.workflow import Workflow
6
- from rapidata.api_client.models.create_order_model import CreateOrderModel
7
- from rapidata.rapidata_client.referee import Referee
8
3
  from rapidata.service.openapi_service import OpenAPIService
9
4
 
10
5
 
@@ -30,14 +25,6 @@ class RapidataOrder:
30
25
  self.order_id = order_id
31
26
  self._dataset = dataset
32
27
 
33
- def create(self):
34
- """
35
- Creates the order using the provided name and workflow.
36
-
37
- :return: The created RapidataOrder instance.
38
- :rtype: RapidataOrder
39
- """
40
-
41
28
  def submit(self):
42
29
  """
43
30
  Submits the order for processing.
@@ -3,6 +3,9 @@ from rapidata.api_client.models.create_order_model import CreateOrderModel
3
3
  from rapidata.api_client.models.create_order_model_referee import (
4
4
  CreateOrderModelReferee,
5
5
  )
6
+ from rapidata.api_client.models.create_order_model_selections_inner import (
7
+ CreateOrderModelSelectionsInner,
8
+ )
6
9
  from rapidata.api_client.models.create_order_model_user_filters_inner import (
7
10
  CreateOrderModelUserFiltersInner,
8
11
  )
@@ -14,6 +17,8 @@ from rapidata.rapidata_client.feature_flags import FeatureFlags
14
17
  from rapidata.rapidata_client.metadata.base_metadata import Metadata
15
18
  from rapidata.rapidata_client.dataset.rapidata_dataset import RapidataDataset
16
19
  from rapidata.rapidata_client.referee.naive_referee import NaiveReferee
20
+ from rapidata.rapidata_client.selection.base_selection import Selection
21
+ from rapidata.rapidata_client.selection.labeling_selection import LabelingSelection
17
22
  from rapidata.rapidata_client.types import RapidAsset
18
23
  from rapidata.rapidata_client.workflow import Workflow
19
24
  from rapidata.rapidata_client.order.rapidata_order import RapidataOrder
@@ -48,6 +53,7 @@ class RapidataOrderBuilder:
48
53
  self._validation_set_id: str | None = None
49
54
  self._feature_flags: FeatureFlags | None = None
50
55
  self._country_codes: list[str] | None = None
56
+ self._selections: list[Selection] = []
51
57
 
52
58
  def _to_model(self) -> CreateOrderModel:
53
59
  if self._workflow is None:
@@ -78,6 +84,10 @@ class RapidataOrderBuilder:
78
84
  if self._feature_flags is not None
79
85
  else None
80
86
  ),
87
+ selections=[
88
+ CreateOrderModelSelectionsInner(selection.to_model())
89
+ for selection in self._selections
90
+ ],
81
91
  )
82
92
 
83
93
  def create(self, submit=True) -> RapidataOrder:
@@ -197,3 +207,13 @@ class RapidataOrderBuilder:
197
207
  """
198
208
  self._validation_set_id = validation_set_id
199
209
  return self
210
+
211
+ def rapids_per_bag(self, amount: int):
212
+ """
213
+ Defines the number of tasks a user sees in a single session. The default is 3.
214
+
215
+ :param amount: The number of tasks a user sees in a single session.
216
+ :type amount: int
217
+ :return: The updated RapidataOrderBuilder instance.
218
+ """
219
+ self._selections.append(LabelingSelection(amount))
@@ -0,0 +1,9 @@
1
+ from abc import abstractmethod
2
+ from typing import Any
3
+
4
+
5
+ class Selection:
6
+
7
+ @abstractmethod
8
+ def to_model(self) -> Any:
9
+ pass
@@ -0,0 +1,14 @@
1
+ from typing import Any
2
+ from rapidata.rapidata_client.selection.base_selection import Selection
3
+ from rapidata.api_client.models.labeling_selection import (
4
+ LabelingSelection as LabelingSelectionModel,
5
+ )
6
+
7
+
8
+ class LabelingSelection(Selection):
9
+
10
+ def __init__(self, amount: int):
11
+ self.amount = amount
12
+
13
+ def to_model(self) -> Any:
14
+ return LabelingSelectionModel(_t="LabelingSelection", amount=self.amount)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: rapidata
3
- Version: 0.1.14
3
+ Version: 0.1.15
4
4
  Summary: Rapidata package containing the Rapidata Python Client to interact with the Rapidata Web API in an easy way.
5
5
  License: Apache-2.0
6
6
  Author: Rapidata AG
@@ -206,13 +206,15 @@ rapidata/rapidata_client/metadata/private_text_metadata.py,sha256=VJ_SJwp8OMFZLu
206
206
  rapidata/rapidata_client/metadata/prompt_metadata.py,sha256=_FypjKWrC3iKUO_G2CVwAGcYbEYClVv4K7upqlnmecw,468
207
207
  rapidata/rapidata_client/metadata/transcription_metadata.py,sha256=THtDEVCON4UlcXHmXrjilaOLHys4TrktUOPGWnXaCcc,631
208
208
  rapidata/rapidata_client/order/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
209
- rapidata/rapidata_client/order/rapidata_order.py,sha256=4a0Sn1y1UmL7HydhaDBOus-g_yILqPQMnTXfLEzQB5g,2997
210
- rapidata/rapidata_client/order/rapidata_order_builder.py,sha256=ucNWVUejksTLIboQYeqExnOuxmhEfhNj56Cuo59FYaU,7000
209
+ rapidata/rapidata_client/order/rapidata_order.py,sha256=VRDLTPBf2k6UihF0DnWq3nfBLWExfWHzh3T-cJgFF1w,2437
210
+ rapidata/rapidata_client/order/rapidata_order_builder.py,sha256=iFIWwAo_fE887WNgykSHp6-2w8G9MIJZIjH07vGX8kQ,7856
211
211
  rapidata/rapidata_client/rapidata_client.py,sha256=BN3bfLEdNLYt7VZuEwDycNPT61wz66TTssjmNlRYlvU,2019
212
212
  rapidata/rapidata_client/referee/__init__.py,sha256=x0AxGCsR6TlDjfqQ00lB9V7QVS9EZCJzweNEIzx42PI,207
213
213
  rapidata/rapidata_client/referee/base_referee.py,sha256=bMy7cw0a-pGNbFu6u_1_Jplu0A483Ubj4oDQzh8vu8k,493
214
214
  rapidata/rapidata_client/referee/classify_early_stopping_referee.py,sha256=-mPTCck81r2xn1GtMoizaOCftA3cOfj6YDSFbqsI3Ic,1140
215
215
  rapidata/rapidata_client/referee/naive_referee.py,sha256=9CSoZou4YBFc9PiRvA2ELVQqyk-S1nug1SqhTwO9Tvw,719
216
+ rapidata/rapidata_client/selection/base_selection.py,sha256=Y3HkROPm4I4HLNiR0HuHKpvk236KkRlsoDxQATm_chY,138
217
+ rapidata/rapidata_client/selection/labeling_selection.py,sha256=cqDMQEXfQGMmgIvPgGOYgIGaXflV_J7LZsGOsakLXqo,425
216
218
  rapidata/rapidata_client/types/__init__.py,sha256=Q9lzemtloA8e_XVVV1Y7ZZGsNg-xRqgj1GdJPrCzo5A,33
217
219
  rapidata/rapidata_client/workflow/__init__.py,sha256=CDG8bKOBhLV4A0uBlqOd__79fH9KW3-UlZsR1RANLf0,250
218
220
  rapidata/rapidata_client/workflow/base_workflow.py,sha256=335UyiNsIFix7ru_KZLeQHvfNg3GSId44ppPmWTXs_Y,1267
@@ -225,7 +227,7 @@ rapidata/service/local_file_service.py,sha256=pgorvlWcx52Uh3cEG6VrdMK_t__7dacQ_5
225
227
  rapidata/service/openapi_service.py,sha256=xNlISI5NZByLy1Yeasc5Uafj1IA2mWJTzxUU1TtwyQU,1402
226
228
  rapidata/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
227
229
  rapidata/utils/image_utils.py,sha256=TldO3eJWG8IhfJjm5MfNGO0mEDm1mQTsRoA0HLU1Uxs,404
228
- rapidata-0.1.14.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
229
- rapidata-0.1.14.dist-info/METADATA,sha256=fJFwoFVeWplRXhdd4MWmc5HnLiCrojo_Htf-54CHDBo,768
230
- rapidata-0.1.14.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
231
- rapidata-0.1.14.dist-info/RECORD,,
230
+ rapidata-0.1.15.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
231
+ rapidata-0.1.15.dist-info/METADATA,sha256=y7chOvpw7mH-nVviDU3hZXWmxRC7Oh3kjLr_p5EVRwM,768
232
+ rapidata-0.1.15.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
233
+ rapidata-0.1.15.dist-info/RECORD,,