rapidata 2.37.0__py3-none-any.whl → 2.39.0__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 +3 -4
- rapidata/api_client/__init__.py +4 -5
- rapidata/api_client/api/benchmark_api.py +289 -3
- rapidata/api_client/api/leaderboard_api.py +35 -1
- rapidata/api_client/api/participant_api.py +289 -3
- rapidata/api_client/api/validation_set_api.py +119 -400
- rapidata/api_client/models/__init__.py +4 -5
- rapidata/api_client/models/ab_test_selection_a_inner.py +1 -1
- rapidata/api_client/models/compare_workflow_model1.py +1 -8
- rapidata/api_client/models/conditional_validation_selection.py +4 -9
- rapidata/api_client/models/confidence_interval.py +98 -0
- rapidata/api_client/models/create_simple_pipeline_model_pipeline_steps_inner.py +8 -22
- rapidata/api_client/models/get_standing_by_id_result.py +7 -2
- rapidata/api_client/models/get_validation_set_by_id_result.py +4 -2
- rapidata/api_client/models/simple_workflow_model1.py +1 -8
- rapidata/api_client/models/standing_by_leaderboard.py +10 -4
- rapidata/api_client/models/update_benchmark_model.py +87 -0
- rapidata/api_client/models/update_participant_model.py +87 -0
- rapidata/api_client/models/update_validation_set_model.py +93 -0
- rapidata/api_client/models/validation_chance.py +20 -3
- rapidata/api_client/models/validation_set_model.py +5 -42
- rapidata/api_client_README.md +7 -7
- rapidata/rapidata_client/__init__.py +1 -4
- rapidata/rapidata_client/api/{rapidata_exception.py → rapidata_api_client.py} +119 -2
- rapidata/rapidata_client/benchmark/leaderboard/rapidata_leaderboard.py +88 -46
- rapidata/rapidata_client/benchmark/participant/_participant.py +26 -9
- rapidata/rapidata_client/benchmark/rapidata_benchmark.py +310 -210
- rapidata/rapidata_client/benchmark/rapidata_benchmark_manager.py +134 -75
- rapidata/rapidata_client/config/__init__.py +3 -0
- rapidata/rapidata_client/config/logger.py +135 -0
- rapidata/rapidata_client/config/logging_config.py +58 -0
- rapidata/rapidata_client/config/managed_print.py +6 -0
- rapidata/rapidata_client/config/order_config.py +14 -0
- rapidata/rapidata_client/config/rapidata_config.py +15 -10
- rapidata/rapidata_client/config/tracer.py +130 -0
- rapidata/rapidata_client/config/upload_config.py +14 -0
- rapidata/rapidata_client/datapoints/_datapoint.py +1 -1
- rapidata/rapidata_client/datapoints/assets/__init__.py +1 -0
- rapidata/rapidata_client/datapoints/assets/_base_asset.py +2 -0
- rapidata/rapidata_client/datapoints/assets/_media_asset.py +1 -1
- rapidata/rapidata_client/datapoints/assets/_sessions.py +2 -2
- rapidata/rapidata_client/datapoints/assets/_text_asset.py +2 -2
- rapidata/rapidata_client/datapoints/assets/data_type_enum.py +1 -1
- rapidata/rapidata_client/datapoints/metadata/_media_asset_metadata.py +9 -8
- rapidata/rapidata_client/datapoints/metadata/_prompt_metadata.py +1 -2
- rapidata/rapidata_client/demographic/demographic_manager.py +16 -14
- rapidata/rapidata_client/filter/_base_filter.py +11 -5
- rapidata/rapidata_client/filter/age_filter.py +9 -3
- rapidata/rapidata_client/filter/and_filter.py +20 -5
- rapidata/rapidata_client/filter/campaign_filter.py +7 -1
- rapidata/rapidata_client/filter/country_filter.py +8 -2
- rapidata/rapidata_client/filter/custom_filter.py +9 -3
- rapidata/rapidata_client/filter/gender_filter.py +9 -3
- rapidata/rapidata_client/filter/language_filter.py +12 -5
- rapidata/rapidata_client/filter/models/age_group.py +4 -4
- rapidata/rapidata_client/filter/models/gender.py +4 -2
- rapidata/rapidata_client/filter/new_user_filter.py +3 -4
- rapidata/rapidata_client/filter/not_filter.py +17 -5
- rapidata/rapidata_client/filter/or_filter.py +20 -5
- rapidata/rapidata_client/filter/rapidata_filters.py +12 -9
- rapidata/rapidata_client/filter/response_count_filter.py +6 -0
- rapidata/rapidata_client/filter/user_score_filter.py +17 -5
- rapidata/rapidata_client/order/_rapidata_dataset.py +45 -17
- rapidata/rapidata_client/order/_rapidata_order_builder.py +19 -13
- rapidata/rapidata_client/order/rapidata_order.py +60 -48
- rapidata/rapidata_client/order/rapidata_order_manager.py +231 -197
- rapidata/rapidata_client/order/rapidata_results.py +71 -57
- rapidata/rapidata_client/rapidata_client.py +36 -23
- rapidata/rapidata_client/referee/__init__.py +1 -1
- rapidata/rapidata_client/referee/_base_referee.py +3 -1
- rapidata/rapidata_client/referee/_early_stopping_referee.py +2 -2
- rapidata/rapidata_client/selection/_base_selection.py +6 -0
- rapidata/rapidata_client/selection/ab_test_selection.py +7 -3
- rapidata/rapidata_client/selection/capped_selection.py +2 -2
- rapidata/rapidata_client/selection/conditional_validation_selection.py +12 -6
- rapidata/rapidata_client/selection/demographic_selection.py +9 -6
- rapidata/rapidata_client/selection/rapidata_selections.py +11 -8
- rapidata/rapidata_client/selection/shuffling_selection.py +5 -5
- rapidata/rapidata_client/selection/static_selection.py +5 -10
- rapidata/rapidata_client/selection/validation_selection.py +9 -5
- rapidata/rapidata_client/settings/_rapidata_setting.py +8 -0
- rapidata/rapidata_client/settings/alert_on_fast_response.py +8 -5
- rapidata/rapidata_client/settings/allow_neither_both.py +1 -0
- rapidata/rapidata_client/settings/custom_setting.py +3 -2
- rapidata/rapidata_client/settings/free_text_minimum_characters.py +9 -4
- rapidata/rapidata_client/settings/models/translation_behaviour_options.py +3 -2
- rapidata/rapidata_client/settings/no_shuffle.py +4 -2
- rapidata/rapidata_client/settings/play_video_until_the_end.py +7 -4
- rapidata/rapidata_client/settings/rapidata_settings.py +4 -3
- rapidata/rapidata_client/settings/translation_behaviour.py +7 -5
- rapidata/rapidata_client/validation/rapidata_validation_set.py +23 -17
- rapidata/rapidata_client/validation/rapids/box.py +3 -1
- rapidata/rapidata_client/validation/rapids/rapids.py +7 -1
- rapidata/rapidata_client/validation/rapids/rapids_manager.py +174 -141
- rapidata/rapidata_client/validation/validation_set_manager.py +285 -268
- rapidata/rapidata_client/workflow/__init__.py +1 -1
- rapidata/rapidata_client/workflow/_base_workflow.py +6 -1
- rapidata/rapidata_client/workflow/_classify_workflow.py +6 -0
- rapidata/rapidata_client/workflow/_compare_workflow.py +6 -0
- rapidata/rapidata_client/workflow/_draw_workflow.py +6 -0
- rapidata/rapidata_client/workflow/_evaluation_workflow.py +6 -0
- rapidata/rapidata_client/workflow/_free_text_workflow.py +6 -0
- rapidata/rapidata_client/workflow/_locate_workflow.py +6 -0
- rapidata/rapidata_client/workflow/_ranking_workflow.py +12 -0
- rapidata/rapidata_client/workflow/_select_words_workflow.py +6 -0
- rapidata/rapidata_client/workflow/_timestamp_workflow.py +6 -0
- rapidata/service/__init__.py +1 -1
- rapidata/service/credential_manager.py +1 -1
- rapidata/service/local_file_service.py +9 -8
- rapidata/service/openapi_service.py +2 -2
- {rapidata-2.37.0.dist-info → rapidata-2.39.0.dist-info}/METADATA +4 -1
- {rapidata-2.37.0.dist-info → rapidata-2.39.0.dist-info}/RECORD +114 -107
- rapidata/rapidata_client/logging/__init__.py +0 -2
- rapidata/rapidata_client/logging/logger.py +0 -122
- rapidata/rapidata_client/logging/output_manager.py +0 -20
- {rapidata-2.37.0.dist-info → rapidata-2.39.0.dist-info}/LICENSE +0 -0
- {rapidata-2.37.0.dist-info → rapidata-2.39.0.dist-info}/WHEEL +0 -0
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
Provides centralized logging configuration for the Rapidata Python SDK.
|
|
3
|
-
It sets up a logger instance that is used throughout the SDK to provide
|
|
4
|
-
consistent logging behavior and formatting.
|
|
5
|
-
|
|
6
|
-
The logger is configured with sensible defaults but can be customized using the
|
|
7
|
-
`configure_logger` function to adjust log levels, output destinations, and formatting.
|
|
8
|
-
|
|
9
|
-
Example:
|
|
10
|
-
Basic usage with default configuration:
|
|
11
|
-
```python
|
|
12
|
-
from rapidata import logger
|
|
13
|
-
|
|
14
|
-
logger.info("This is an info message")
|
|
15
|
-
logger.error("This is an error message")
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
Custom configuration:
|
|
19
|
-
```python
|
|
20
|
-
from rapidata import configure_logger
|
|
21
|
-
|
|
22
|
-
# Configure with DEBUG level and file output
|
|
23
|
-
configure_logger(
|
|
24
|
-
level="DEBUG",
|
|
25
|
-
log_file="/path/to/logs/rapidata.log"
|
|
26
|
-
)
|
|
27
|
-
```
|
|
28
|
-
"""
|
|
29
|
-
import logging
|
|
30
|
-
import os
|
|
31
|
-
from typing import Optional
|
|
32
|
-
|
|
33
|
-
# Create module-level logger
|
|
34
|
-
logger = logging.getLogger("rapidata")
|
|
35
|
-
|
|
36
|
-
def configure_logger(
|
|
37
|
-
level: str = "WARNING",
|
|
38
|
-
log_file: Optional[str] = None,
|
|
39
|
-
format_string: str = "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
|
|
40
|
-
) -> None:
|
|
41
|
-
"""
|
|
42
|
-
Configure the logger with custom settings.
|
|
43
|
-
|
|
44
|
-
This function allows you to customize the logging behavior for the entire SDK.
|
|
45
|
-
You can set the log level, specify a file for log output, and customize the log message format.
|
|
46
|
-
|
|
47
|
-
Note:
|
|
48
|
-
This function removes any existing handlers before adding new ones,
|
|
49
|
-
so it's safe to call multiple times to reconfigure logging.
|
|
50
|
-
|
|
51
|
-
Args:
|
|
52
|
-
level: The logging level to set. Must be one of:\n
|
|
53
|
-
- "DEBUG": Detailed information for diagnosing problems
|
|
54
|
-
- "INFO": General information about program execution
|
|
55
|
-
- "WARNING": Something unexpected happened (default)
|
|
56
|
-
- "ERROR": A serious problem occurred
|
|
57
|
-
- "CRITICAL": A very serious error occurred
|
|
58
|
-
|
|
59
|
-
log_file: Optional path to a file where logs should be written.
|
|
60
|
-
If provided, logs will be written to both console and file.
|
|
61
|
-
The directory will be created if it doesn't exist.
|
|
62
|
-
|
|
63
|
-
format_string: Custom format string for log messages.
|
|
64
|
-
Uses Python logging format specifications.
|
|
65
|
-
Default includes timestamp, logger name, level, and message.
|
|
66
|
-
|
|
67
|
-
Example:
|
|
68
|
-
Configure for development with debug logging:
|
|
69
|
-
```python
|
|
70
|
-
configure_logger(level="DEBUG")
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
Configure for production with file logging:
|
|
74
|
-
```python
|
|
75
|
-
configure_logger(
|
|
76
|
-
level="INFO",
|
|
77
|
-
log_file="/var/log/rapidata/app.log"
|
|
78
|
-
)
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
Configure with custom format:
|
|
82
|
-
```python
|
|
83
|
-
configure_logger(
|
|
84
|
-
level="INFO",
|
|
85
|
-
format_string="[%(levelname)s] %(message)s"
|
|
86
|
-
)
|
|
87
|
-
```
|
|
88
|
-
"""
|
|
89
|
-
# Map string levels to logging constants for validation and conversion
|
|
90
|
-
level_map = {
|
|
91
|
-
"DEBUG": logging.DEBUG,
|
|
92
|
-
"INFO": logging.INFO,
|
|
93
|
-
"WARNING": logging.WARNING,
|
|
94
|
-
"ERROR": logging.ERROR,
|
|
95
|
-
"CRITICAL": logging.CRITICAL
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
numeric_level = level_map.get(level.upper(), logging.INFO)
|
|
99
|
-
logger.setLevel(numeric_level)
|
|
100
|
-
|
|
101
|
-
# Remove existing handlers if any
|
|
102
|
-
for handler in logger.handlers[:]:
|
|
103
|
-
logger.removeHandler(handler)
|
|
104
|
-
|
|
105
|
-
# Create formatter
|
|
106
|
-
formatter = logging.Formatter(format_string)
|
|
107
|
-
|
|
108
|
-
# Console handler
|
|
109
|
-
console_handler = logging.StreamHandler()
|
|
110
|
-
console_handler.setFormatter(formatter)
|
|
111
|
-
logger.addHandler(console_handler)
|
|
112
|
-
|
|
113
|
-
# File handler (optional)
|
|
114
|
-
if log_file:
|
|
115
|
-
log_dir = os.path.dirname(log_file)
|
|
116
|
-
if log_dir:
|
|
117
|
-
os.makedirs(log_dir, exist_ok=True)
|
|
118
|
-
file_handler = logging.FileHandler(log_file)
|
|
119
|
-
file_handler.setFormatter(formatter)
|
|
120
|
-
logger.addHandler(file_handler)
|
|
121
|
-
|
|
122
|
-
configure_logger()
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
class RapidataOutputManager:
|
|
2
|
-
"""Manages print outputs and progress bars for the Rapidata module."""
|
|
3
|
-
|
|
4
|
-
silent_mode: bool = False
|
|
5
|
-
|
|
6
|
-
@classmethod
|
|
7
|
-
def enable_silent_mode(cls) -> None:
|
|
8
|
-
"""Enable silent mode, suppressing all print outputs and progress bars, not logging."""
|
|
9
|
-
cls.silent_mode = True
|
|
10
|
-
|
|
11
|
-
@classmethod
|
|
12
|
-
def disable_silent_mode(cls) -> None:
|
|
13
|
-
"""Disable silent mode, allowing outputs to be printed.
|
|
14
|
-
This is the default behavior.
|
|
15
|
-
"""
|
|
16
|
-
cls.silent_mode = False
|
|
17
|
-
|
|
18
|
-
def managed_print(*args, **kwargs) -> None:
|
|
19
|
-
if not RapidataOutputManager.silent_mode:
|
|
20
|
-
print(*args, **kwargs)
|
|
File without changes
|
|
File without changes
|