rapidata 2.42.6__py3-none-any.whl → 2.42.8__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 CHANGED
@@ -1,4 +1,4 @@
1
- __version__ = "2.42.6"
1
+ __version__ = "2.42.8"
2
2
 
3
3
  from .rapidata_client import (
4
4
  RapidataClient,
@@ -17,6 +17,7 @@ from .rapidata_client import (
17
17
  FreeTextMinimumCharacters,
18
18
  NoShuffle,
19
19
  PlayVideoUntilTheEnd,
20
+ MuteVideo,
20
21
  CustomSetting,
21
22
  AllowNeitherBoth,
22
23
  SwapContextInstruction,
@@ -27,6 +27,7 @@ from .settings import (
27
27
  CustomSetting,
28
28
  AllowNeitherBoth,
29
29
  SwapContextInstruction,
30
+ MuteVideo,
30
31
  )
31
32
  from .filter import (
32
33
  CountryFilter,
@@ -1,4 +1,4 @@
1
- import re
1
+ import pandas as pd
2
2
  import urllib.parse
3
3
  import webbrowser
4
4
  from colorama import Fore
@@ -479,6 +479,33 @@ class RapidataBenchmark:
479
479
  + Fore.RESET
480
480
  )
481
481
 
482
+ def get_overall_standings(self, tags: Optional[list[str]] = None) -> pd.DataFrame:
483
+ """
484
+ Returns an aggregated elo table of all leaderboards in the benchmark.
485
+ """
486
+ with tracer.start_as_current_span("get_overall_standings"):
487
+ participants = self._openapi_service.benchmark_api.benchmark_benchmark_id_standings_get(
488
+ benchmark_id=self.id,
489
+ tags=tags,
490
+ )
491
+
492
+ standings = []
493
+ for participant in participants.items:
494
+ standings.append(
495
+ {
496
+ "name": participant.name,
497
+ "wins": participant.wins,
498
+ "total_matches": participant.total_matches,
499
+ "score": (
500
+ round(participant.score, 2)
501
+ if participant.score is not None
502
+ else None
503
+ ),
504
+ }
505
+ )
506
+
507
+ return pd.DataFrame(standings)
508
+
482
509
  def __str__(self) -> str:
483
510
  return f"RapidataBenchmark(name={self.name}, id={self.id})"
484
511
 
@@ -23,12 +23,15 @@ class UserScoreFilter(RapidataFilter, BaseModel):
23
23
  This will only show the order to users that have a UserScore of >=0.5 and <=0.9
24
24
  """
25
25
 
26
- lower_bound: float = 0.0
27
- upper_bound: float = 1.0
26
+ lower_bound: float
27
+ upper_bound: float
28
28
  dimension: str | None = None
29
29
 
30
30
  def __init__(
31
- self, lower_bound: float, upper_bound: float, dimension: str | None = None
31
+ self,
32
+ lower_bound: float = 0.0,
33
+ upper_bound: float = 1.0,
34
+ dimension: str | None = None,
32
35
  ):
33
36
  super().__init__(
34
37
  lower_bound=lower_bound, upper_bound=upper_bound, dimension=dimension
@@ -8,4 +8,5 @@ from .custom_setting import CustomSetting
8
8
  from ._rapidata_setting import RapidataSetting
9
9
  from .allow_neither_both import AllowNeitherBoth
10
10
  from .swap_context_instruction import SwapContextInstruction
11
+ from .mute_video import MuteVideo
11
12
  from .rapidata_settings import RapidataSettings
@@ -12,4 +12,6 @@ class AllowNeitherBoth(RapidataSetting):
12
12
  """
13
13
 
14
14
  def __init__(self, value: bool = True):
15
+ if not isinstance(value, bool):
16
+ raise ValueError("The value must be a boolean.")
15
17
  super().__init__(key="compare_unsure", value=value)
@@ -0,0 +1,15 @@
1
+ from rapidata.rapidata_client.settings._rapidata_setting import RapidataSetting
2
+
3
+
4
+ class MuteVideo(RapidataSetting):
5
+ """
6
+ Mute the video. If this setting is not supplied, the video will not be muted.
7
+
8
+ Args:
9
+ value (bool): Whether to mute the video. Defaults to True.
10
+ """
11
+
12
+ def __init__(self, value: bool = True):
13
+ if not isinstance(value, bool):
14
+ raise ValueError("The value must be a boolean.")
15
+ super().__init__(key="mute_video_asset", value=value)
@@ -6,6 +6,7 @@ from rapidata.rapidata_client.settings import (
6
6
  PlayVideoUntilTheEnd,
7
7
  AllowNeitherBoth,
8
8
  SwapContextInstruction,
9
+ MuteVideo,
9
10
  )
10
11
 
11
12
 
@@ -23,6 +24,7 @@ class RapidataSettings:
23
24
  play_video_until_the_end (PlayVideoUntilTheEnd): Allows users to only answer once the video has finished playing.
24
25
  allow_neither_both (AllowNeitherBoth): Only for compare tasks. If true, the users will be able to select neither or both instead of exclusively one of the options.
25
26
  swap_context_instruction (SwapContextInstruction): Swap the place of the context and instruction.
27
+ mute_video (MuteVideo): Mute the video.
26
28
 
27
29
  Example:
28
30
  ```python
@@ -40,9 +42,10 @@ class RapidataSettings:
40
42
  play_video_until_the_end = PlayVideoUntilTheEnd
41
43
  allow_neither_both = AllowNeitherBoth
42
44
  swap_context_instruction = SwapContextInstruction
45
+ mute_video = MuteVideo
43
46
 
44
47
  def __str__(self) -> str:
45
- return f"RapidataSettings(alert_on_fast_response={self.alert_on_fast_response}, translation_behaviour={self.translation_behaviour}, free_text_minimum_characters={self.free_text_minimum_characters}, no_shuffle={self.no_shuffle}, play_video_until_the_end={self.play_video_until_the_end}, allow_neither_both={self.allow_neither_both}, swap_context_instruction={self.swap_context_instruction})"
48
+ return f"RapidataSettings(alert_on_fast_response={self.alert_on_fast_response}, translation_behaviour={self.translation_behaviour}, free_text_minimum_characters={self.free_text_minimum_characters}, no_shuffle={self.no_shuffle}, play_video_until_the_end={self.play_video_until_the_end}, allow_neither_both={self.allow_neither_both}, swap_context_instruction={self.swap_context_instruction}, mute_video={self.mute_video})"
46
49
 
47
50
  def __repr__(self) -> str:
48
51
  return self.__str__()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rapidata
3
- Version: 2.42.6
3
+ Version: 2.42.8
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
  License-File: LICENSE
@@ -1,4 +1,4 @@
1
- rapidata/__init__.py,sha256=rsgNfH2hEqJNu89zai9F2RcA8MnUGP9XS6OX5HM3bKc,857
1
+ rapidata/__init__.py,sha256=Wour_mnWfBvZzS6vyY8wmx-oX9J8ii9a3Z_L8OXca14,872
2
2
  rapidata/api_client/__init__.py,sha256=Rh2aAoa6nDv09Z7cpTNdrPotXixBcNN_2VevCDD1goc,37144
3
3
  rapidata/api_client/api/__init__.py,sha256=CaZJ54mxbAEzAFd0Cjy0mfiUabD-d_7tqVOgjU4RxZI,1749
4
4
  rapidata/api_client/api/asset_api.py,sha256=buYMBGvg5_SLkJ7aG07c7_1rT6TXTCqoLfoV8O2nJhM,34442
@@ -599,7 +599,7 @@ rapidata/api_client/models/workflow_state.py,sha256=5LAK1se76RCoozeVB6oxMPb8p_5b
599
599
  rapidata/api_client/models/zip_entry_file_wrapper.py,sha256=-c8uJo-Dd-FGYPLzUR8sHV2waucFoDwEaJ_ztDGW7vc,5830
600
600
  rapidata/api_client/rest.py,sha256=rtIMcgINZOUaDFaJIinJkXRSddNJmXvMRMfgO2Ezk2o,10835
601
601
  rapidata/api_client_README.md,sha256=0AWEwcE005y5Q8IBzgEWgOa-iwqImdbY99RnQnlei70,63261
602
- rapidata/rapidata_client/__init__.py,sha256=j9nyFoKDOu8LyV9jcYaOqOL4kAbLf_TYaZkAg20969c,1080
602
+ rapidata/rapidata_client/__init__.py,sha256=5rurgu-1s65Hazm61g-zNishhocWBuG0BuV83EkgBfA,1095
603
603
  rapidata/rapidata_client/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
604
604
  rapidata/rapidata_client/api/rapidata_api_client.py,sha256=9385bND7sDuXfmq0AFgea_RrtuT73NA2CWG_9aIoGok,8945
605
605
  rapidata/rapidata_client/benchmark/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -608,7 +608,7 @@ rapidata/rapidata_client/benchmark/leaderboard/__init__.py,sha256=47DEQpj8HBSa-_
608
608
  rapidata/rapidata_client/benchmark/leaderboard/rapidata_leaderboard.py,sha256=BPNTrKeEGvISdzAe_OpIIUtdX4tYgh_2g9w7YOnytA4,7840
609
609
  rapidata/rapidata_client/benchmark/participant/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
610
610
  rapidata/rapidata_client/benchmark/participant/_participant.py,sha256=rrjWkH8MO-Jow0Tpg4ejMmhyD2h-_s1-YzM2Seeu_Z8,5344
611
- rapidata/rapidata_client/benchmark/rapidata_benchmark.py,sha256=9Xk7WhuD8C7gPv2C4QVR_EdyKlIxjPiddHM6s3-dBT0,19925
611
+ rapidata/rapidata_client/benchmark/rapidata_benchmark.py,sha256=LTRbakqmYFFx3lswj0X3Axv4V3bk-9-cAKJn6ivNUpw,20977
612
612
  rapidata/rapidata_client/benchmark/rapidata_benchmark_manager.py,sha256=5f7tLU39wyOt8rc-3MEqVdc6ANmP2j6hfzAupTCbHD0,8870
613
613
  rapidata/rapidata_client/config/__init__.py,sha256=AdL9mKlOa_xm3spFKPBBdTYzhioQh7-UvXd6t84wlDk,238
614
614
  rapidata/rapidata_client/config/logger.py,sha256=nQl9w6wLdvKGJFqtEQWoUBAlDtvYmo3w4ekIx4sNynI,5518
@@ -653,7 +653,7 @@ rapidata/rapidata_client/filter/not_filter.py,sha256=BfGx3db9tRGrNj6YHXK8tiyVXaz
653
653
  rapidata/rapidata_client/filter/or_filter.py,sha256=IabAoq15IhTGQrse_9_DMGCX-lUV_mx3vN4sM3fypA4,1400
654
654
  rapidata/rapidata_client/filter/rapidata_filters.py,sha256=B8ptQsaAn1e14Grv8xBYQ4qcU0Vt2VTjEpkk-tyOCTo,2201
655
655
  rapidata/rapidata_client/filter/response_count_filter.py,sha256=5vxBWh7VUarIIkfZRscPCDhqOptvar-2GOvbKmiJ6Y8,2199
656
- rapidata/rapidata_client/filter/user_score_filter.py,sha256=hX-8IT03SqyJ48WAgsYH75mXHHfXtrae7pcGIvfeBKU,1905
656
+ rapidata/rapidata_client/filter/user_score_filter.py,sha256=z2wvyrEWsCCm1I_CbzmjLzK-pDsScWkNWIKB57F_TGU,1930
657
657
  rapidata/rapidata_client/order/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
658
658
  rapidata/rapidata_client/order/_rapidata_order_builder.py,sha256=FTJJRCW9KehIlqELOXmKeLhuGcLj9m9ImEU1agOIRa4,16915
659
659
  rapidata/rapidata_client/order/dataset/_rapidata_dataset.py,sha256=8EhoRVBxWMbp1mtS56Uogg2dwFC2vySw5hNqTPDTHzM,6345
@@ -678,17 +678,18 @@ rapidata/rapidata_client/selection/rapidata_selections.py,sha256=EdH0DGmDYEkfsAg
678
678
  rapidata/rapidata_client/selection/shuffling_selection.py,sha256=uAl3eB_qd_s4tANaFu9zaYSk73pDWvcixYwBCMGEzKc,1362
679
679
  rapidata/rapidata_client/selection/static_selection.py,sha256=aKpTZXrA6o2qJFCX7jqbX1BRUuKXcV7RqokoOaBqhZw,669
680
680
  rapidata/rapidata_client/selection/validation_selection.py,sha256=K8GviasRlMFSLUZdVqjBaMGIrsShnwuihenG07mci7A,1095
681
- rapidata/rapidata_client/settings/__init__.py,sha256=UC_6nrhS4q7zqio30-T1dMT9AtFhIfu5g_xhhIeAH1Y,568
681
+ rapidata/rapidata_client/settings/__init__.py,sha256=eHBKWdweEztOtZg5TX4Z5BJyCC90nz-58vaiqjsH8gY,602
682
682
  rapidata/rapidata_client/settings/_rapidata_setting.py,sha256=ZiTzyEr9ihFif0av9CroY1KJ4PfFMB_cV_nrvBsG--s,583
683
683
  rapidata/rapidata_client/settings/alert_on_fast_response.py,sha256=VYOQ1EfKolYmsNNI4gJPx-_UWFl9dtrroca796jrAZI,1007
684
- rapidata/rapidata_client/settings/allow_neither_both.py,sha256=c92e3d-TAB7-Isv3O3zPibaGm_Uj2Uy-NhyCzdyhnXM,540
684
+ rapidata/rapidata_client/settings/allow_neither_both.py,sha256=OiRUuuR9xJ8Dtl0hpHiCIHK-SS1vu1GJ_ztnx3Fkhw4,641
685
685
  rapidata/rapidata_client/settings/custom_setting.py,sha256=YhVr5uvsp4GT6nXzZqgzbKPrcNlMkRB4alYtFqk_Na4,568
686
686
  rapidata/rapidata_client/settings/free_text_minimum_characters.py,sha256=m3C28_OhJNCiy2GKwi9VIXOSamjoHKDZUyVYdYFCWCg,777
687
687
  rapidata/rapidata_client/settings/models/__init__.py,sha256=IW7OuWg7xWIwFYrMAOX5N0HGGcqE6fFpgYin3vWRkOU,71
688
688
  rapidata/rapidata_client/settings/models/translation_behaviour_options.py,sha256=shbCpoi8bOqIArcZtnBL9ZRvUsyVXwjs3nRj9-uzZw4,472
689
+ rapidata/rapidata_client/settings/mute_video.py,sha256=F8uUfqvhjySNLqC6IVv9QVOa-l-oKaiXfOtn90BTTzQ,500
689
690
  rapidata/rapidata_client/settings/no_shuffle.py,sha256=RJKJl76vyakEQ6tyA-06GSo3wF57uxTjF-4f07gK_Gg,674
690
691
  rapidata/rapidata_client/settings/play_video_until_the_end.py,sha256=vPtIYql197Q0h6N_TlYuI3AbakBJUmnYUmhoSns9EWc,754
691
- rapidata/rapidata_client/settings/rapidata_settings.py,sha256=ae_NwycNqvA2q-lnnkDohS8IduG2DBtyqLJlgt3PXBA,2501
692
+ rapidata/rapidata_client/settings/rapidata_settings.py,sha256=ByThJw1df3jEvz8-8a6txxyF2cHINpxXcbaLWpVZCmc,2621
692
693
  rapidata/rapidata_client/settings/swap_context_instruction.py,sha256=DLa1CDKIHVWC0VBOYTbb9HZBebzsaIGT_2DHq9I0ovs,712
693
694
  rapidata/rapidata_client/settings/translation_behaviour.py,sha256=uEke2WgzrjzRlSROgeyP7v9t5ayFynHzytjIU_gVu3Y,741
694
695
  rapidata/rapidata_client/validation/__init__.py,sha256=s5wHVtcJkncXSFuL9I0zNwccNOKpWAqxqUjkeohzi2E,24
@@ -715,7 +716,7 @@ rapidata/service/credential_manager.py,sha256=T3yL4tXVnibRytxjQkOC-ex3kFGQR5KcKU
715
716
  rapidata/service/local_file_service.py,sha256=0Q4LdoEtPFKzgXK2oZ1cQ-X7FipakscjGnnBH8dRFRQ,855
716
717
  rapidata/service/openapi_service.py,sha256=E2zVagI_ri15PK06ITO_VNKYDJ0VZQG1YQ1T6bEIVsY,5566
717
718
  rapidata/types/__init__.py,sha256=NLRuTGbTImRv3yIp8we_oqVvCuBd7TDNVlAzkVGs9oo,6056
718
- rapidata-2.42.6.dist-info/METADATA,sha256=hGaKKniKHnrpgC3qBq6r1FQbzzk7af7zh9x2-1UY71g,1479
719
- rapidata-2.42.6.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
720
- rapidata-2.42.6.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
721
- rapidata-2.42.6.dist-info/RECORD,,
719
+ rapidata-2.42.8.dist-info/METADATA,sha256=VsHfP0Grd0sNyKFng-VDXCUD4sIQsiaNZmP4gbgFFgE,1479
720
+ rapidata-2.42.8.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
721
+ rapidata-2.42.8.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
722
+ rapidata-2.42.8.dist-info/RECORD,,