rapidata 2.25.0__py3-none-any.whl → 2.26.1__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.
Potentially problematic release.
This version of rapidata might be problematic. Click here for more details.
- rapidata/__init__.py +2 -2
- rapidata/rapidata_client/__init__.py +1 -1
- rapidata/rapidata_client/filter/_base_filter.py +31 -0
- rapidata/rapidata_client/filter/rapidata_filters.py +11 -0
- rapidata/rapidata_client/logging/__init__.py +1 -1
- rapidata/rapidata_client/logging/output_manager.py +2 -2
- rapidata/rapidata_client/order/_rapidata_dataset.py +3 -3
- rapidata/rapidata_client/order/rapidata_order.py +3 -3
- rapidata/rapidata_client/order/rapidata_order_manager.py +2 -3
- rapidata/rapidata_client/validation/validation_set_manager.py +2 -3
- {rapidata-2.25.0.dist-info → rapidata-2.26.1.dist-info}/METADATA +1 -1
- {rapidata-2.25.0.dist-info → rapidata-2.26.1.dist-info}/RECORD +14 -14
- {rapidata-2.25.0.dist-info → rapidata-2.26.1.dist-info}/LICENSE +0 -0
- {rapidata-2.25.0.dist-info → rapidata-2.26.1.dist-info}/WHEEL +0 -0
rapidata/__init__.py
CHANGED
|
@@ -8,3 +8,34 @@ class RapidataFilter:
|
|
|
8
8
|
@abstractmethod
|
|
9
9
|
def _to_model(self) -> Any:
|
|
10
10
|
pass
|
|
11
|
+
|
|
12
|
+
def __or__(self, other):
|
|
13
|
+
"""Enable the | operator to create OrFilter combinations."""
|
|
14
|
+
if not isinstance(other, RapidataFilter):
|
|
15
|
+
return NotImplemented
|
|
16
|
+
|
|
17
|
+
from rapidata.rapidata_client.filter.or_filter import OrFilter
|
|
18
|
+
|
|
19
|
+
# If self is already an OrFilter, extend its filters list
|
|
20
|
+
if isinstance(self, OrFilter):
|
|
21
|
+
if isinstance(other, OrFilter):
|
|
22
|
+
return OrFilter(self.filters + other.filters)
|
|
23
|
+
else:
|
|
24
|
+
return OrFilter(self.filters + [other])
|
|
25
|
+
# If other is an OrFilter, prepend self to its filters
|
|
26
|
+
elif isinstance(other, OrFilter):
|
|
27
|
+
return OrFilter([self] + other.filters)
|
|
28
|
+
# Neither is an OrFilter, create a new one
|
|
29
|
+
else:
|
|
30
|
+
return OrFilter([self, other])
|
|
31
|
+
|
|
32
|
+
def __invert__(self):
|
|
33
|
+
"""Enable the ~ operator to create NotFilter negations."""
|
|
34
|
+
from rapidata.rapidata_client.filter.not_filter import NotFilter
|
|
35
|
+
|
|
36
|
+
# If self is already a NotFilter, return the original filter (double negation)
|
|
37
|
+
if isinstance(self, NotFilter):
|
|
38
|
+
return self.filter
|
|
39
|
+
# Create a new NotFilter
|
|
40
|
+
else:
|
|
41
|
+
return NotFilter(self)
|
|
@@ -33,6 +33,17 @@ class RapidataFilters:
|
|
|
33
33
|
```
|
|
34
34
|
|
|
35
35
|
This ensures the order is only shown to users in the US and Germany whose phones are set to English.
|
|
36
|
+
|
|
37
|
+
Info:
|
|
38
|
+
The or and not filter support the | and ~ operators respectively.
|
|
39
|
+
The and is given by the elements in the list.
|
|
40
|
+
|
|
41
|
+
```python
|
|
42
|
+
from rapidata import AgeFilter, LanguageFilter, CountryFilter
|
|
43
|
+
filters=[~AgeFilter([AgeGroup.UNDER_18]), CountryFilter(["US"]) | LanguageFilter(["en"])]
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
This would return users who are not under 18 years old and are from the US or whose phones are set to English.
|
|
36
47
|
"""
|
|
37
48
|
user_score = UserScoreFilter
|
|
38
49
|
age = AgeFilter
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
from .logger import configure_logger, logger
|
|
2
|
-
from .output_manager import managed_print,
|
|
2
|
+
from .output_manager import managed_print, RapidataOutputManger
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
class
|
|
1
|
+
class RapidataOutputManger:
|
|
2
2
|
silent_mode = False
|
|
3
3
|
|
|
4
4
|
@classmethod
|
|
@@ -10,7 +10,7 @@ class OutputManger:
|
|
|
10
10
|
cls.silent_mode = False
|
|
11
11
|
|
|
12
12
|
def managed_print(*args, **kwargs):
|
|
13
|
-
if not
|
|
13
|
+
if not RapidataOutputManger.silent_mode:
|
|
14
14
|
print(*args, **kwargs)
|
|
15
15
|
|
|
16
16
|
|
|
@@ -17,7 +17,7 @@ from tqdm import tqdm
|
|
|
17
17
|
|
|
18
18
|
from pydantic import StrictStr
|
|
19
19
|
from typing import cast, Sequence, Generator
|
|
20
|
-
from rapidata.rapidata_client.logging import logger
|
|
20
|
+
from rapidata.rapidata_client.logging import logger, RapidataOutputManger
|
|
21
21
|
import time
|
|
22
22
|
import threading
|
|
23
23
|
|
|
@@ -76,7 +76,7 @@ class RapidataDataset:
|
|
|
76
76
|
for i, (text_asset, metadata) in enumerate(zip_longest(text_assets, metadata_list or []))
|
|
77
77
|
]
|
|
78
78
|
|
|
79
|
-
with tqdm(total=total_uploads, desc="Uploading text datapoints") as pbar:
|
|
79
|
+
with tqdm(total=total_uploads, desc="Uploading text datapoints", disable=RapidataOutputManger.silent_mode) as pbar:
|
|
80
80
|
for future in as_completed(futures):
|
|
81
81
|
future.result() # This will raise any exceptions that occurred during execution
|
|
82
82
|
pbar.update(1)
|
|
@@ -183,7 +183,7 @@ class RapidataDataset:
|
|
|
183
183
|
def progress_tracking_thread():
|
|
184
184
|
try:
|
|
185
185
|
# Initialize progress bar with 0 completions
|
|
186
|
-
with tqdm(total=total_uploads, desc="Uploading datapoints") as pbar:
|
|
186
|
+
with tqdm(total=total_uploads, desc="Uploading datapoints", disable=RapidataOutputManger.silent_mode) as pbar:
|
|
187
187
|
prev_ready = 0
|
|
188
188
|
prev_failed = 0
|
|
189
189
|
stall_count = 0
|
|
@@ -16,7 +16,7 @@ from rapidata.api_client.models.preliminary_download_model import PreliminaryDow
|
|
|
16
16
|
from rapidata.api_client.models.workflow_artifact_model import WorkflowArtifactModel
|
|
17
17
|
from rapidata.rapidata_client.order.rapidata_results import RapidataResults
|
|
18
18
|
from rapidata.service.openapi_service import OpenAPIService
|
|
19
|
-
from rapidata.rapidata_client.logging import logger, managed_print
|
|
19
|
+
from rapidata.rapidata_client.logging import logger, managed_print, RapidataOutputManger
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
class RapidataOrder:
|
|
@@ -125,8 +125,8 @@ class RapidataOrder:
|
|
|
125
125
|
"To speed up the process, contact support (info@rapidata.ai).\n"
|
|
126
126
|
"Once started, run this method again to display the progress bar."
|
|
127
127
|
)
|
|
128
|
-
|
|
129
|
-
with tqdm(total=100, desc="Processing order", unit="%", bar_format="{desc}: {percentage:3.0f}%|{bar}| completed [{elapsed}<{remaining}, {rate_fmt}]") as pbar:
|
|
128
|
+
|
|
129
|
+
with tqdm(total=100, desc="Processing order", unit="%", bar_format="{desc}: {percentage:3.0f}%|{bar}| completed [{elapsed}<{remaining}, {rate_fmt}]", disable=RapidataOutputManger.silent_mode) as pbar:
|
|
130
130
|
last_percentage = 0
|
|
131
131
|
while True:
|
|
132
132
|
current_percentage = self._workflow_progress.completion_percentage
|
|
@@ -28,9 +28,8 @@ from rapidata.rapidata_client.filter import RapidataFilter
|
|
|
28
28
|
from rapidata.rapidata_client.filter.rapidata_filters import RapidataFilters
|
|
29
29
|
from rapidata.rapidata_client.settings import RapidataSettings, RapidataSetting
|
|
30
30
|
from rapidata.rapidata_client.selection.rapidata_selections import RapidataSelections
|
|
31
|
-
from rapidata.rapidata_client.logging import logger
|
|
31
|
+
from rapidata.rapidata_client.logging import logger, RapidataOutputManger
|
|
32
32
|
|
|
33
|
-
from rapidata.api_client.exceptions import BadRequestException
|
|
34
33
|
from rapidata.api_client.models.query_model import QueryModel
|
|
35
34
|
from rapidata.api_client.models.page_info import PageInfo
|
|
36
35
|
from rapidata.api_client.models.root_filter import RootFilter
|
|
@@ -604,7 +603,7 @@ class RapidataOrderManager:
|
|
|
604
603
|
|
|
605
604
|
assets = [MediaAsset(path=path) for path in datapoints]
|
|
606
605
|
|
|
607
|
-
for asset in tqdm(assets, desc="Downloading assets and checking duration"):
|
|
606
|
+
for asset in tqdm(assets, desc="Downloading assets and checking duration", disable=RapidataOutputManger.silent_mode):
|
|
608
607
|
if not asset.get_duration():
|
|
609
608
|
raise ValueError("The datapoints for this order must have a duration. (e.g. video or audio)")
|
|
610
609
|
|
|
@@ -11,12 +11,11 @@ from rapidata.api_client.models.page_info import PageInfo
|
|
|
11
11
|
from rapidata.api_client.models.root_filter import RootFilter
|
|
12
12
|
from rapidata.api_client.models.filter import Filter
|
|
13
13
|
from rapidata.api_client.models.sort_criterion import SortCriterion
|
|
14
|
-
from rapidata.api_client.exceptions import BadRequestException
|
|
15
14
|
from urllib3._collections import HTTPHeaderDict # type: ignore[import]
|
|
16
15
|
|
|
17
16
|
from rapidata.rapidata_client.validation.rapids.box import Box
|
|
18
17
|
|
|
19
|
-
from rapidata.rapidata_client.logging import logger, managed_print
|
|
18
|
+
from rapidata.rapidata_client.logging import logger, managed_print, RapidataOutputManger
|
|
20
19
|
from tqdm import tqdm
|
|
21
20
|
|
|
22
21
|
|
|
@@ -453,7 +452,7 @@ class ValidationSetManager:
|
|
|
453
452
|
)
|
|
454
453
|
|
|
455
454
|
logger.debug("Adding rapids to validation set")
|
|
456
|
-
for rapid in tqdm(rapids, desc="Uploading validation tasks"):
|
|
455
|
+
for rapid in tqdm(rapids, desc="Uploading validation tasks", disable=RapidataOutputManger.silent_mode):
|
|
457
456
|
validation_set.add_rapid(rapid)
|
|
458
457
|
|
|
459
458
|
managed_print()
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
rapidata/__init__.py,sha256=
|
|
1
|
+
rapidata/__init__.py,sha256=E6KiyHYdwdMkex7C_M9aNYkG2PAhNdhAWe7ePp3MpxI,811
|
|
2
2
|
rapidata/api_client/__init__.py,sha256=ueQCSv2aouXRHG6n2VdmXKMWq8_nguUeoA9oV9L8PQ4,27456
|
|
3
3
|
rapidata/api_client/api/__init__.py,sha256=kxo-WoJb_QrJccktYJgKVVc674eT-scwggMvMZ3Spj8,1211
|
|
4
4
|
rapidata/api_client/api/campaign_api.py,sha256=1ajX0hSnA4O5GacJLIGkAgorPlNDRVaEZY029Pkutl4,71353
|
|
@@ -427,7 +427,7 @@ rapidata/api_client/models/workflow_split_model_filter_configs_inner.py,sha256=1
|
|
|
427
427
|
rapidata/api_client/models/workflow_state.py,sha256=5LAK1se76RCoozeVB6oxMPb8p_5bhLZJqn7q5fFQWis,850
|
|
428
428
|
rapidata/api_client/rest.py,sha256=rtIMcgINZOUaDFaJIinJkXRSddNJmXvMRMfgO2Ezk2o,10835
|
|
429
429
|
rapidata/api_client_README.md,sha256=1GZEvjvNdHtkVFndp26uSCA6FpzrApoNIvTMDRrwZjM,54986
|
|
430
|
-
rapidata/rapidata_client/__init__.py,sha256=
|
|
430
|
+
rapidata/rapidata_client/__init__.py,sha256=TeuZfkXtIJuFrcS23ATnKN17iVxSKf3z0gZ9eWOb82A,1079
|
|
431
431
|
rapidata/rapidata_client/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
432
432
|
rapidata/rapidata_client/api/rapidata_exception.py,sha256=BIdmHRrJUGW-Mqhp1H_suemZaR6w9TgjWq-ZW5iUPdQ,3878
|
|
433
433
|
rapidata/rapidata_client/assets/__init__.py,sha256=eQkqUrYFME1FCxPY2Xh2bbonKVPnsFElJ6aPFcsWGxI,361
|
|
@@ -442,7 +442,7 @@ rapidata/rapidata_client/country_codes/country_codes.py,sha256=ePHqeb7y9DWQZAndd
|
|
|
442
442
|
rapidata/rapidata_client/demographic/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
443
443
|
rapidata/rapidata_client/demographic/demographic_manager.py,sha256=RE4r6NNAXinNAlRMgAcG4te4pF4whv81xbyAW2V9XMM,1192
|
|
444
444
|
rapidata/rapidata_client/filter/__init__.py,sha256=SqxlEotA_O1Lgw3Um6VPBE2P5Hw7OUVZRSBbsv1GJbI,514
|
|
445
|
-
rapidata/rapidata_client/filter/_base_filter.py,sha256=
|
|
445
|
+
rapidata/rapidata_client/filter/_base_filter.py,sha256=EytjAqeDX_x3D5WoFwwtr8L2ok5-Ga-JEvkRnkuBQbw,1433
|
|
446
446
|
rapidata/rapidata_client/filter/age_filter.py,sha256=oRjGY65gE_X8oa0D0XRyvKAb4_Z6XOOaGTWykRSfLFA,739
|
|
447
447
|
rapidata/rapidata_client/filter/campaign_filter.py,sha256=6ZT11-gub8349QcRwuHt8AcBY18F7BdLRZ2Ch_vjLyU,735
|
|
448
448
|
rapidata/rapidata_client/filter/country_filter.py,sha256=JqCzxePRizXQbN4YzwLmrx9ozKgw0ra6N_enEq36imI,948
|
|
@@ -455,12 +455,12 @@ rapidata/rapidata_client/filter/models/gender.py,sha256=aXg6Kql2BIy8d5d1lCVi1axM
|
|
|
455
455
|
rapidata/rapidata_client/filter/new_user_filter.py,sha256=qU7d6cSslGEO_N1tYPS4Ru3cGbQYH2_I5dJPNPHvtCM,369
|
|
456
456
|
rapidata/rapidata_client/filter/not_filter.py,sha256=I7crEyOCs53uS0VI48s9EqC6PAFfV9EZG3upwFBJwZo,1189
|
|
457
457
|
rapidata/rapidata_client/filter/or_filter.py,sha256=u6vkXMTG_j15SbY3bkbnXbxJMDgEsH5rdoFLbuoLQmo,1345
|
|
458
|
-
rapidata/rapidata_client/filter/rapidata_filters.py,sha256=
|
|
458
|
+
rapidata/rapidata_client/filter/rapidata_filters.py,sha256=mx_r6rqEtm6pEe8d0hCEamk2nyplzZ9Hp-AlH98IhRU,1910
|
|
459
459
|
rapidata/rapidata_client/filter/response_count_filter.py,sha256=sDv9Dvy0FbnIQRSAxFGrUf9SIMISTNxnlAQcrFKBjXE,1989
|
|
460
460
|
rapidata/rapidata_client/filter/user_score_filter.py,sha256=2C78zkWm5TnfkxGbV1ER2xB7s9ynpacaibzyRZKG8Cc,1566
|
|
461
|
-
rapidata/rapidata_client/logging/__init__.py,sha256=
|
|
461
|
+
rapidata/rapidata_client/logging/__init__.py,sha256=ip_DwOOMwdj2TdMUcJqigke7q-1A7PIGrQweZNk39D8,109
|
|
462
462
|
rapidata/rapidata_client/logging/logger.py,sha256=CR_FJRVkHi1tVcJ42aYNj75HX7kr5trKBCXvPLCsnSk,1368
|
|
463
|
-
rapidata/rapidata_client/logging/output_manager.py,sha256=
|
|
463
|
+
rapidata/rapidata_client/logging/output_manager.py,sha256=4T9_NFDulnz1FJof9Cpdy2hPL-VdCvVXtV_mYDlE0hI,345
|
|
464
464
|
rapidata/rapidata_client/metadata/__init__.py,sha256=G_mnLo2q4S_V9BjTCTJVNZZqnmwU6OaHNkuxNSNnRQA,302
|
|
465
465
|
rapidata/rapidata_client/metadata/_base_metadata.py,sha256=t2kFqaz5BkEaYYj93Pw3h7zWVDq_S5ZkDxjDIRd21_I,189
|
|
466
466
|
rapidata/rapidata_client/metadata/_media_asset_metadata.py,sha256=muyWV9QAdz_8s6N0Zp8qzqDXiNI0N54HS-3K5hDRG5c,529
|
|
@@ -469,10 +469,10 @@ rapidata/rapidata_client/metadata/_prompt_metadata.py,sha256=ecycAq_t2HCEptxgNxy
|
|
|
469
469
|
rapidata/rapidata_client/metadata/_public_text_metadata.py,sha256=uXavDp1ucy_9u5n0girqWD_SkFr7tplGMK_2aqyyHIA,529
|
|
470
470
|
rapidata/rapidata_client/metadata/_select_words_metadata.py,sha256=-MK5yQDi_G3BKEes6aaVyCcobB-sEy29b6bfo5f4pic,594
|
|
471
471
|
rapidata/rapidata_client/order/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
472
|
-
rapidata/rapidata_client/order/_rapidata_dataset.py,sha256=
|
|
472
|
+
rapidata/rapidata_client/order/_rapidata_dataset.py,sha256=BSyY2J-l-W59IZp59rG4UJA4D1Ui_4B2Yn-eFj1Oqmc,19921
|
|
473
473
|
rapidata/rapidata_client/order/_rapidata_order_builder.py,sha256=x-2lpW6Jwlq-9XRz91beWNv2TgdEA-q4b_RhOSr7vhQ,14405
|
|
474
|
-
rapidata/rapidata_client/order/rapidata_order.py,sha256=
|
|
475
|
-
rapidata/rapidata_client/order/rapidata_order_manager.py,sha256=
|
|
474
|
+
rapidata/rapidata_client/order/rapidata_order.py,sha256=V1CUXqjYRN_phSv3May2N5KHpM_wSeLDiPVH0KXM4Fc,12413
|
|
475
|
+
rapidata/rapidata_client/order/rapidata_order_manager.py,sha256=fVMgz-HwtfXKBpWZIytc6O9UiRhH5r0IRWjd0Xx747E,38210
|
|
476
476
|
rapidata/rapidata_client/order/rapidata_results.py,sha256=UllYpuqpm2inKdRNhClaUwApuxsMLrvrGDsrHA5KqbY,8111
|
|
477
477
|
rapidata/rapidata_client/rapidata_client.py,sha256=iAycSS8Dyt0_xnILpU5N9DoeGlB3v2UtlinmxcFh-eo,4029
|
|
478
478
|
rapidata/rapidata_client/referee/__init__.py,sha256=q0Hv9nmfEpyChejtyMLT8hWKL0vTTf_UgUXPYNJ-H6M,153
|
|
@@ -508,7 +508,7 @@ rapidata/rapidata_client/validation/rapids/__init__.py,sha256=WU5PPwtTJlte6U90MD
|
|
|
508
508
|
rapidata/rapidata_client/validation/rapids/box.py,sha256=t3_Kn6doKXdnJdtbwefXnYKPiTKHneJl9E2inkDSqL8,589
|
|
509
509
|
rapidata/rapidata_client/validation/rapids/rapids.py,sha256=e8XHYf0QdCsyDGUnrmZvGHRUp9h-WXh1n5R-LdTB3ZQ,4936
|
|
510
510
|
rapidata/rapidata_client/validation/rapids/rapids_manager.py,sha256=s5VAq8H5CKACWfmIQuz9kHC8t2nd-xEHGGUj9pIfXKI,14386
|
|
511
|
-
rapidata/rapidata_client/validation/validation_set_manager.py,sha256=
|
|
511
|
+
rapidata/rapidata_client/validation/validation_set_manager.py,sha256=ToKIaMGEsFRQ2XjZ6RjMrWXmwBxaMqtoQSYw-b8VFEY,25696
|
|
512
512
|
rapidata/rapidata_client/workflow/__init__.py,sha256=7nXcY91xkxjHudBc9H0fP35eBBtgwHGWTQKbb-M4h7Y,477
|
|
513
513
|
rapidata/rapidata_client/workflow/_base_workflow.py,sha256=XyIZFKS_RxAuwIHS848S3AyLEHqd07oTD_5jm2oUbsw,762
|
|
514
514
|
rapidata/rapidata_client/workflow/_classify_workflow.py,sha256=9bT54wxVJgxC-zLk6MVNbseFpzYrvFPjt7DHvxqYfnk,1736
|
|
@@ -524,7 +524,7 @@ rapidata/service/__init__.py,sha256=s9bS1AJZaWIhLtJX_ZA40_CK39rAAkwdAmymTMbeWl4,
|
|
|
524
524
|
rapidata/service/credential_manager.py,sha256=FAH9PJreDAw3G9cJ_iwzvz99s9RnFDrxxV0BHb2VYAI,8698
|
|
525
525
|
rapidata/service/local_file_service.py,sha256=pgorvlWcx52Uh3cEG6VrdMK_t__7dacQ_5AnfY14BW8,877
|
|
526
526
|
rapidata/service/openapi_service.py,sha256=J07TB4P3cz9KCU7k_fwuMQwGXlq_nJx_m1_xHbZoCg0,4867
|
|
527
|
-
rapidata-2.
|
|
528
|
-
rapidata-2.
|
|
529
|
-
rapidata-2.
|
|
530
|
-
rapidata-2.
|
|
527
|
+
rapidata-2.26.1.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
528
|
+
rapidata-2.26.1.dist-info/METADATA,sha256=n01LS9Pbys9zwObwNuKrZxSQBaTk6vP0_tfPKaC4bdg,1268
|
|
529
|
+
rapidata-2.26.1.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
530
|
+
rapidata-2.26.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|