scalebox-sdk 0.1.14__py3-none-any.whl → 0.1.16__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.
- scalebox/__init__.py +1 -1
- scalebox/code_interpreter/code_interpreter_async.py +370 -369
- scalebox/code_interpreter/code_interpreter_sync.py +318 -317
- scalebox/csx_desktop/main.py +8 -8
- scalebox/test/CODE_INTERPRETER_TESTS_READY.md +256 -256
- scalebox/test/README.md +164 -164
- scalebox/version.py +2 -2
- {scalebox_sdk-0.1.14.dist-info → scalebox_sdk-0.1.16.dist-info}/METADATA +98 -95
- {scalebox_sdk-0.1.14.dist-info → scalebox_sdk-0.1.16.dist-info}/RECORD +13 -13
- {scalebox_sdk-0.1.14.dist-info → scalebox_sdk-0.1.16.dist-info}/WHEEL +0 -0
- {scalebox_sdk-0.1.14.dist-info → scalebox_sdk-0.1.16.dist-info}/entry_points.txt +0 -0
- {scalebox_sdk-0.1.14.dist-info → scalebox_sdk-0.1.16.dist-info}/licenses/LICENSE +0 -0
- {scalebox_sdk-0.1.14.dist-info → scalebox_sdk-0.1.16.dist-info}/top_level.txt +0 -0
scalebox/csx_desktop/main.py
CHANGED
|
@@ -307,16 +307,16 @@ class Sandbox(SandboxBase):
|
|
|
307
307
|
proxy: Optional[ProxyTypes] = None,
|
|
308
308
|
) -> "Sandbox":
|
|
309
309
|
"""
|
|
310
|
-
|
|
310
|
+
Synchronously create or connect to a desktop sandbox.
|
|
311
311
|
|
|
312
|
-
|
|
312
|
+
Parameters have the same meaning as the base class. Xvfb + xfce4 will be automatically started on first creation.
|
|
313
313
|
"""
|
|
314
314
|
display = display or ":0"
|
|
315
315
|
if envs is None:
|
|
316
316
|
envs = {}
|
|
317
317
|
envs["DISPLAY"] = display
|
|
318
318
|
|
|
319
|
-
# 1.
|
|
319
|
+
# 1. Let the parent class factory actually create / reuse
|
|
320
320
|
base = SandboxBase.create(
|
|
321
321
|
template=template or cls.default_template,
|
|
322
322
|
timeout=timeout,
|
|
@@ -330,27 +330,27 @@ class Sandbox(SandboxBase):
|
|
|
330
330
|
proxy=proxy,
|
|
331
331
|
)
|
|
332
332
|
|
|
333
|
-
# 2.
|
|
333
|
+
# 2. Dynamically upgrade type to Sandbox
|
|
334
334
|
base.__class__ = cls
|
|
335
335
|
base._display = display
|
|
336
336
|
base._last_xfce4_pid = None
|
|
337
337
|
|
|
338
|
-
# 3.
|
|
338
|
+
# 3. Only start desktop on first creation
|
|
339
339
|
if not sandbox_id:
|
|
340
340
|
base._start_desktop(resolution, dpi)
|
|
341
341
|
else:
|
|
342
|
-
#
|
|
342
|
+
# Connect to existing sandbox, only initialize VNC
|
|
343
343
|
base.__vnc_server = _VNCServer(base)
|
|
344
344
|
|
|
345
345
|
return base
|
|
346
346
|
|
|
347
|
-
# ======================
|
|
347
|
+
# ====================== Subclass Private Methods ======================
|
|
348
348
|
def _start_desktop(
|
|
349
349
|
self,
|
|
350
350
|
resolution: Optional[Tuple[int, int]] = None,
|
|
351
351
|
dpi: Optional[int] = None,
|
|
352
352
|
) -> None:
|
|
353
|
-
"""
|
|
353
|
+
"""Start Xvfb and wait for success, then start xfce4 + VNC."""
|
|
354
354
|
width, height = resolution or (1024, 768)
|
|
355
355
|
self.commands.run(
|
|
356
356
|
f"Xvfb {self._display} -ac -screen 0 {width}x{height}x24 "
|
|
@@ -1,78 +1,78 @@
|
|
|
1
|
-
# ✅ Code Interpreter
|
|
1
|
+
# ✅ Code Interpreter Test Suite Complete
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Following the style of `test_sandbox_sync_comprehensive.py` and `test_sandbox_async_comprehensive.py`, a complete Code Interpreter test suite has been successfully created.
|
|
4
4
|
|
|
5
|
-
## 📁
|
|
5
|
+
## 📁 Created Files
|
|
6
6
|
|
|
7
|
-
### 🧪
|
|
7
|
+
### 🧪 Comprehensive Test Files
|
|
8
8
|
1. **`test_code_interpreter_sync_comprehensive.py`** (24.6KB)
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
9
|
+
- Comprehensive test suite for synchronous version
|
|
10
|
+
- Uses `CodeInterpreterValidator` class
|
|
11
|
+
- Contains 17+ detailed test cases
|
|
12
12
|
|
|
13
13
|
2. **`test_code_interpreter_async_comprehensive.py`** (26.2KB)
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
14
|
+
- Comprehensive test suite for asynchronous version
|
|
15
|
+
- Uses `AsyncCodeInterpreterValidator` class
|
|
16
|
+
- Contains 11+ async test cases
|
|
17
17
|
|
|
18
|
-
### 🎯
|
|
18
|
+
### 🎯 Simple Test Examples
|
|
19
19
|
3. **`testcodeinterpreter_sync.py`** (3.4KB)
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
20
|
+
- Simple, straightforward synchronous test examples
|
|
21
|
+
- Similar to `testsandbox_sync.py` style
|
|
22
|
+
- Suitable for quick basic functionality verification
|
|
23
23
|
|
|
24
24
|
4. **`testcodeinterpreter_async.py`** (7.2KB)
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
-
|
|
25
|
+
- Simple, straightforward asynchronous test examples
|
|
26
|
+
- Similar to `testsandbox_async.py` style
|
|
27
|
+
- Demonstrates async code execution and concurrent processing
|
|
28
28
|
|
|
29
|
-
### 🚀
|
|
29
|
+
### 🚀 Run Scripts
|
|
30
30
|
5. **`run_code_interpreter_tests.sh`** (2KB)
|
|
31
|
-
-
|
|
32
|
-
-
|
|
33
|
-
-
|
|
34
|
-
|
|
35
|
-
## 📊
|
|
36
|
-
|
|
37
|
-
###
|
|
38
|
-
- ✅
|
|
39
|
-
- ✅
|
|
40
|
-
- ✅
|
|
41
|
-
- ✅
|
|
42
|
-
- ✅
|
|
43
|
-
- ✅
|
|
44
|
-
- ✅
|
|
45
|
-
- ✅
|
|
46
|
-
- ✅
|
|
47
|
-
- ✅
|
|
48
|
-
- ✅
|
|
49
|
-
- ✅ **R
|
|
50
|
-
- ✅
|
|
51
|
-
|
|
52
|
-
###
|
|
53
|
-
- ✅
|
|
54
|
-
- ✅
|
|
55
|
-
- ✅
|
|
56
|
-
- ✅
|
|
57
|
-
- ✅
|
|
58
|
-
- ✅
|
|
59
|
-
- ✅
|
|
60
|
-
- ✅
|
|
61
|
-
- ✅
|
|
62
|
-
- ✅ **WebSocket
|
|
63
|
-
|
|
64
|
-
## 🎨
|
|
65
|
-
|
|
66
|
-
###
|
|
67
|
-
-
|
|
68
|
-
- `test_results`
|
|
69
|
-
- `run_test()`
|
|
70
|
-
- `log_test_result()`
|
|
71
|
-
- `cleanup()`
|
|
72
|
-
- `print_summary()`
|
|
73
|
-
-
|
|
74
|
-
|
|
75
|
-
###
|
|
31
|
+
- Interactive test execution script
|
|
32
|
+
- Supports selection of different test types
|
|
33
|
+
- One-click to run all tests
|
|
34
|
+
|
|
35
|
+
## 📊 Test Coverage
|
|
36
|
+
|
|
37
|
+
### Synchronous Test Coverage
|
|
38
|
+
- ✅ **Basic Code Execution** - Python code interpretation and execution
|
|
39
|
+
- ✅ **Mathematical Computation** - numpy, math library usage
|
|
40
|
+
- ✅ **Data Processing** - pandas data analysis
|
|
41
|
+
- ✅ **Data Visualization** - matplotlib chart generation
|
|
42
|
+
- ✅ **Callback Handling** - stdout, stderr, result, error callbacks
|
|
43
|
+
- ✅ **Context Management** - creation, persistence, multiple contexts
|
|
44
|
+
- ✅ **Error Handling** - syntax errors, runtime errors
|
|
45
|
+
- ✅ **Data Type Testing** - various Python data types
|
|
46
|
+
- ✅ **File Operations** - file read/write operations
|
|
47
|
+
- ✅ **Performance Testing** - computational performance, concurrency simulation
|
|
48
|
+
- ✅ **Result Format Testing** - text, HTML, Markdown, SVG, images, LaTeX, JSON, JavaScript, chart data, mixed formats
|
|
49
|
+
- ✅ **R Language Support** - R language basic execution, data analysis, visualization, statistical analysis, context management
|
|
50
|
+
- ✅ **Network Request Simulation** - API call simulation
|
|
51
|
+
|
|
52
|
+
### Asynchronous Test Coverage
|
|
53
|
+
- ✅ **Async Code Execution** - async/await syntax support
|
|
54
|
+
- ✅ **Concurrent Code Execution** - multi-task concurrent processing
|
|
55
|
+
- ✅ **Async Data Science** - asynchronous data processing workflows
|
|
56
|
+
- ✅ **Async Callback Handling** - asynchronous callback functions
|
|
57
|
+
- ✅ **Async Context Management** - asynchronous context state management
|
|
58
|
+
- ✅ **Async Performance Testing** - concurrent tasks, batch processing performance
|
|
59
|
+
- ✅ **Async Error Handling** - asynchronous error catching
|
|
60
|
+
- ✅ **Async Result Format Testing** - async text generation, mixed formats, real-time data stream processing
|
|
61
|
+
- ✅ **Async R Language Support** - async R language basic execution, data analysis, visualization, statistical analysis, context management
|
|
62
|
+
- ✅ **WebSocket Simulation** - asynchronous WebSocket connection simulation
|
|
63
|
+
|
|
64
|
+
## 🎨 Test Style Features
|
|
65
|
+
|
|
66
|
+
### Following Sandbox Test Style
|
|
67
|
+
- Uses `Validator` class structure
|
|
68
|
+
- `test_results` list records test results
|
|
69
|
+
- `run_test()` method executes individual tests
|
|
70
|
+
- `log_test_result()` records test status
|
|
71
|
+
- `cleanup()` method cleans up resources
|
|
72
|
+
- `print_summary()` generates test reports
|
|
73
|
+
- Test methods start with `test_`
|
|
74
|
+
|
|
75
|
+
### Test Structure Example
|
|
76
76
|
```python
|
|
77
77
|
class CodeInterpreterValidator:
|
|
78
78
|
def __init__(self):
|
|
@@ -81,44 +81,44 @@ class CodeInterpreterValidator:
|
|
|
81
81
|
self.failed_tests = []
|
|
82
82
|
|
|
83
83
|
def run_test(self, test_func, test_name: str):
|
|
84
|
-
#
|
|
84
|
+
# Execute test and record results
|
|
85
85
|
|
|
86
86
|
def test_basic_python_execution(self):
|
|
87
|
-
#
|
|
87
|
+
# Specific test logic
|
|
88
88
|
|
|
89
89
|
def cleanup(self):
|
|
90
|
-
#
|
|
90
|
+
# Clean up sandbox resources
|
|
91
91
|
|
|
92
92
|
def print_summary(self):
|
|
93
|
-
#
|
|
93
|
+
# Print test summary
|
|
94
94
|
```
|
|
95
95
|
|
|
96
|
-
## 🚀
|
|
96
|
+
## 🚀 Running Methods
|
|
97
97
|
|
|
98
|
-
### 1.
|
|
98
|
+
### 1. Use Run Script (Recommended)
|
|
99
99
|
```bash
|
|
100
100
|
cd scalebox/test
|
|
101
101
|
./run_code_interpreter_tests.sh
|
|
102
102
|
```
|
|
103
103
|
|
|
104
|
-
### 2.
|
|
104
|
+
### 2. Run Test Files Directly
|
|
105
105
|
```bash
|
|
106
|
-
#
|
|
106
|
+
# Simple synchronous tests
|
|
107
107
|
python3 testcodeinterpreter_sync.py
|
|
108
108
|
|
|
109
|
-
#
|
|
109
|
+
# Simple asynchronous tests
|
|
110
110
|
python3 testcodeinterpreter_async.py
|
|
111
111
|
|
|
112
|
-
#
|
|
112
|
+
# Comprehensive synchronous tests
|
|
113
113
|
python3 test_code_interpreter_sync_comprehensive.py
|
|
114
114
|
|
|
115
|
-
#
|
|
115
|
+
# Comprehensive asynchronous tests
|
|
116
116
|
python3 test_code_interpreter_async_comprehensive.py
|
|
117
117
|
```
|
|
118
118
|
|
|
119
|
-
### 3.
|
|
119
|
+
### 3. Test Specific Features Separately
|
|
120
120
|
```bash
|
|
121
|
-
#
|
|
121
|
+
# Test only basic functionality
|
|
122
122
|
python3 -c "
|
|
123
123
|
from test_code_interpreter_sync_comprehensive import CodeInterpreterValidator
|
|
124
124
|
validator = CodeInterpreterValidator()
|
|
@@ -127,197 +127,197 @@ validator.cleanup()
|
|
|
127
127
|
"
|
|
128
128
|
```
|
|
129
129
|
|
|
130
|
-
## 📋
|
|
130
|
+
## 📋 Test Report Example
|
|
131
131
|
|
|
132
|
-
|
|
132
|
+
After running, a report in the following format will be generated:
|
|
133
133
|
```
|
|
134
134
|
============================================================
|
|
135
|
-
CodeInterpreter
|
|
135
|
+
CodeInterpreter Comprehensive Verification Test Report
|
|
136
136
|
============================================================
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
137
|
+
Total Tests: 17
|
|
138
|
+
Passed: 16
|
|
139
|
+
Failed: 1
|
|
140
|
+
Total Time: 45.234s
|
|
141
|
+
Success Rate: 94.1%
|
|
142
142
|
|
|
143
|
-
|
|
143
|
+
Failed Tests:
|
|
144
144
|
❌ Visualization Code
|
|
145
145
|
|
|
146
146
|
============================================================
|
|
147
147
|
```
|
|
148
148
|
|
|
149
|
-
## 🎨
|
|
150
|
-
|
|
151
|
-
###
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
#### 📝
|
|
155
|
-
-
|
|
156
|
-
-
|
|
157
|
-
-
|
|
158
|
-
-
|
|
159
|
-
|
|
160
|
-
#### 🌐
|
|
161
|
-
-
|
|
162
|
-
- CSS
|
|
163
|
-
-
|
|
164
|
-
-
|
|
165
|
-
|
|
166
|
-
#### 📋 Markdown
|
|
167
|
-
-
|
|
168
|
-
-
|
|
169
|
-
-
|
|
170
|
-
-
|
|
171
|
-
|
|
172
|
-
#### 🖼️
|
|
173
|
-
-
|
|
174
|
-
-
|
|
175
|
-
-
|
|
176
|
-
-
|
|
177
|
-
|
|
178
|
-
#### 📊
|
|
179
|
-
- matplotlib
|
|
180
|
-
-
|
|
181
|
-
-
|
|
182
|
-
-
|
|
183
|
-
|
|
184
|
-
#### 📄 LaTeX
|
|
185
|
-
-
|
|
186
|
-
-
|
|
187
|
-
-
|
|
188
|
-
-
|
|
189
|
-
|
|
190
|
-
#### 📈 JSON
|
|
191
|
-
-
|
|
192
|
-
-
|
|
193
|
-
-
|
|
194
|
-
-
|
|
195
|
-
|
|
196
|
-
#### ⚡ JavaScript
|
|
197
|
-
-
|
|
198
|
-
-
|
|
199
|
-
-
|
|
200
|
-
-
|
|
201
|
-
|
|
202
|
-
#### 📊
|
|
203
|
-
- Chart.js
|
|
204
|
-
-
|
|
205
|
-
-
|
|
206
|
-
-
|
|
207
|
-
|
|
208
|
-
#### 🎨
|
|
209
|
-
-
|
|
210
|
-
-
|
|
211
|
-
-
|
|
212
|
-
-
|
|
213
|
-
|
|
214
|
-
###
|
|
215
|
-
-
|
|
216
|
-
-
|
|
217
|
-
-
|
|
218
|
-
-
|
|
219
|
-
|
|
220
|
-
## 🔬 R
|
|
221
|
-
|
|
222
|
-
###
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
#### 📊 **R
|
|
226
|
-
- R
|
|
227
|
-
-
|
|
228
|
-
-
|
|
229
|
-
-
|
|
230
|
-
|
|
231
|
-
#### 📈 **R
|
|
232
|
-
- dplyr
|
|
233
|
-
-
|
|
234
|
-
-
|
|
235
|
-
-
|
|
236
|
-
|
|
237
|
-
#### 📊 **R
|
|
238
|
-
- ggplot2
|
|
239
|
-
-
|
|
240
|
-
-
|
|
241
|
-
-
|
|
242
|
-
|
|
243
|
-
#### 📉 **R
|
|
244
|
-
-
|
|
245
|
-
- t
|
|
246
|
-
-
|
|
247
|
-
-
|
|
248
|
-
|
|
249
|
-
#### 🔄 **R
|
|
250
|
-
- R
|
|
251
|
-
-
|
|
252
|
-
-
|
|
253
|
-
-
|
|
254
|
-
|
|
255
|
-
###
|
|
256
|
-
-
|
|
257
|
-
-
|
|
258
|
-
-
|
|
259
|
-
-
|
|
260
|
-
-
|
|
261
|
-
|
|
262
|
-
### R
|
|
263
|
-
-
|
|
264
|
-
-
|
|
265
|
-
-
|
|
266
|
-
-
|
|
267
|
-
-
|
|
268
|
-
|
|
269
|
-
## 💡
|
|
270
|
-
|
|
271
|
-
### 1.
|
|
272
|
-
-
|
|
273
|
-
-
|
|
274
|
-
-
|
|
275
|
-
-
|
|
276
|
-
-
|
|
277
|
-
-
|
|
278
|
-
|
|
279
|
-
### 2.
|
|
280
|
-
-
|
|
281
|
-
-
|
|
282
|
-
-
|
|
283
|
-
-
|
|
284
|
-
|
|
285
|
-
### 3.
|
|
286
|
-
-
|
|
287
|
-
-
|
|
288
|
-
-
|
|
289
|
-
-
|
|
290
|
-
|
|
291
|
-
### 4.
|
|
292
|
-
-
|
|
293
|
-
-
|
|
294
|
-
-
|
|
295
|
-
-
|
|
296
|
-
|
|
297
|
-
## 🎯
|
|
298
|
-
|
|
299
|
-
1.
|
|
300
|
-
2.
|
|
301
|
-
3.
|
|
302
|
-
4.
|
|
303
|
-
5.
|
|
304
|
-
|
|
305
|
-
## 📝
|
|
306
|
-
|
|
307
|
-
1.
|
|
308
|
-
2.
|
|
309
|
-
3.
|
|
310
|
-
4.
|
|
311
|
-
5.
|
|
149
|
+
## 🎨 Result Format Support (New Feature)
|
|
150
|
+
|
|
151
|
+
### Complete Result Class Format Testing
|
|
152
|
+
Based on the provided `Result` class definition, comprehensive tests for all result formats have been added:
|
|
153
|
+
|
|
154
|
+
#### 📝 Text Format (text)
|
|
155
|
+
- Plain text result output
|
|
156
|
+
- Multi-line text processing
|
|
157
|
+
- Chinese content support
|
|
158
|
+
- Formatted text display
|
|
159
|
+
|
|
160
|
+
#### 🌐 Web Format (html)
|
|
161
|
+
- Complete HTML document generation
|
|
162
|
+
- CSS style support
|
|
163
|
+
- Table and list rendering
|
|
164
|
+
- Responsive design
|
|
165
|
+
|
|
166
|
+
#### 📋 Markdown Format (markdown)
|
|
167
|
+
- Standard Markdown syntax
|
|
168
|
+
- Tables, lists, code blocks
|
|
169
|
+
- Links and image references
|
|
170
|
+
- Mathematical formula display
|
|
171
|
+
|
|
172
|
+
#### 🖼️ Vector Graphics (svg)
|
|
173
|
+
- Dynamic SVG graphics
|
|
174
|
+
- Progress bar animations
|
|
175
|
+
- Interactive charts
|
|
176
|
+
- Vector graphic optimization
|
|
177
|
+
|
|
178
|
+
#### 📊 Image Formats (png/jpeg)
|
|
179
|
+
- matplotlib charts to base64
|
|
180
|
+
- Multi-subplot complex charts
|
|
181
|
+
- High-quality image output
|
|
182
|
+
- Compression optimization
|
|
183
|
+
|
|
184
|
+
#### 📄 LaTeX Format (latex)
|
|
185
|
+
- Complete LaTeX documents
|
|
186
|
+
- Mathematical formula rendering
|
|
187
|
+
- Tables and figures
|
|
188
|
+
- Academic paper formatting
|
|
189
|
+
|
|
190
|
+
#### 📈 JSON Data (json_data)
|
|
191
|
+
- Structured data output
|
|
192
|
+
- Nested object handling
|
|
193
|
+
- Arrays and complex types
|
|
194
|
+
- Performance metric data
|
|
195
|
+
|
|
196
|
+
#### ⚡ JavaScript Code (javascript)
|
|
197
|
+
- Interactive UI components
|
|
198
|
+
- Real-time data updates
|
|
199
|
+
- Event handling mechanisms
|
|
200
|
+
- Chart library integration
|
|
201
|
+
|
|
202
|
+
#### 📊 Chart Data (chart)
|
|
203
|
+
- Chart.js compatible format
|
|
204
|
+
- Multiple chart types
|
|
205
|
+
- Interactive configuration
|
|
206
|
+
- Data export functionality
|
|
207
|
+
|
|
208
|
+
#### 🎨 Mixed Formats (mixed)
|
|
209
|
+
- Simultaneously generate multiple formats
|
|
210
|
+
- Data correlation between formats
|
|
211
|
+
- Unified style design
|
|
212
|
+
- Complete report generation
|
|
213
|
+
|
|
214
|
+
### Asynchronous Result Format Enhancement
|
|
215
|
+
- **Async Text Generation**: Non-blocking text processing
|
|
216
|
+
- **Concurrent Format Processing**: Generate multiple formats simultaneously
|
|
217
|
+
- **Real-time Data Streams**: Dynamic data collection and processing
|
|
218
|
+
- **Performance Optimization**: Async I/O and resource management
|
|
219
|
+
|
|
220
|
+
## 🔬 R Language Support (New Feature)
|
|
221
|
+
|
|
222
|
+
### Complete R Language Kernel Testing
|
|
223
|
+
Based on code-interpreter's R language support, comprehensive R language test cases have been added:
|
|
224
|
+
|
|
225
|
+
#### 📊 **R Language Basic Execution** (`test_r_language_basic_execution`)
|
|
226
|
+
- R language basic syntax and variable operations
|
|
227
|
+
- Vector operations and data frame creation
|
|
228
|
+
- Basic math and statistical functions
|
|
229
|
+
- Data structures and type handling
|
|
230
|
+
|
|
231
|
+
#### 📈 **R Language Data Analysis** (`test_r_language_data_analysis`)
|
|
232
|
+
- dplyr package data operations
|
|
233
|
+
- Data filtering, grouping, and aggregation
|
|
234
|
+
- Data frame operations and transformations
|
|
235
|
+
- Complex data queries and statistics
|
|
236
|
+
|
|
237
|
+
#### 📊 **R Language Data Visualization** (`test_r_language_visualization`)
|
|
238
|
+
- ggplot2 package advanced charts
|
|
239
|
+
- Scatter plots, box plots, histograms
|
|
240
|
+
- Multi-chart combinations and theme settings
|
|
241
|
+
- Data visualization best practices
|
|
242
|
+
|
|
243
|
+
#### 📉 **R Language Statistical Analysis** (`test_r_language_statistics`)
|
|
244
|
+
- Descriptive statistical analysis
|
|
245
|
+
- t-tests and hypothesis testing
|
|
246
|
+
- Correlation analysis and regression analysis
|
|
247
|
+
- Normality tests and statistical inference
|
|
248
|
+
|
|
249
|
+
#### 🔄 **R Language Context Management** (`test_r_language_context_management`)
|
|
250
|
+
- R language dedicated context creation
|
|
251
|
+
- Global variables and function definitions
|
|
252
|
+
- Context state persistence
|
|
253
|
+
- Resource cleanup and management
|
|
254
|
+
|
|
255
|
+
### Asynchronous R Language Support
|
|
256
|
+
- **Async R Language Basic Execution**: Non-blocking R code execution
|
|
257
|
+
- **Async R Language Data Analysis**: Concurrent data processing
|
|
258
|
+
- **Async R Language Visualization**: Asynchronous chart generation
|
|
259
|
+
- **Async R Language Statistics**: Concurrent statistical analysis
|
|
260
|
+
- **Async R Language Context**: Asynchronous context management
|
|
261
|
+
|
|
262
|
+
### R Language Test Features
|
|
263
|
+
- **Real Environment**: Uses real R kernel execution
|
|
264
|
+
- **Complete Coverage**: Covers R language core functionality
|
|
265
|
+
- **Library Support**: Tests dplyr, ggplot2, stats and other common packages
|
|
266
|
+
- **Context Isolation**: Each test uses independent R context
|
|
267
|
+
- **Resource Management**: Automatic cleanup of R language context resources
|
|
268
|
+
|
|
269
|
+
## 💡 Featured Functionality
|
|
270
|
+
|
|
271
|
+
### 1. Rich Code Examples
|
|
272
|
+
- Mathematical calculations (trigonometric functions, statistical analysis)
|
|
273
|
+
- Data processing (pandas data analysis)
|
|
274
|
+
- Data visualization (matplotlib charts)
|
|
275
|
+
- Asynchronous programming (async/await, concurrency)
|
|
276
|
+
- Batch processing (concurrent data processing)
|
|
277
|
+
- Network simulation (API calls, WebSocket)
|
|
278
|
+
|
|
279
|
+
### 2. Complete Error Handling
|
|
280
|
+
- Syntax error catching
|
|
281
|
+
- Runtime error handling
|
|
282
|
+
- Asynchronous error handling
|
|
283
|
+
- Callback function error handling
|
|
284
|
+
|
|
285
|
+
### 3. Performance Testing
|
|
286
|
+
- Computational performance benchmarking
|
|
287
|
+
- Concurrent execution performance testing
|
|
288
|
+
- Asynchronous batch processing performance testing
|
|
289
|
+
- Throughput and efficiency analysis
|
|
290
|
+
|
|
291
|
+
### 4. Context Management
|
|
292
|
+
- Multiple independent contexts
|
|
293
|
+
- Context state persistence
|
|
294
|
+
- Asynchronous context state management
|
|
295
|
+
- Isolation verification between contexts
|
|
296
|
+
|
|
297
|
+
## 🎯 Use Cases
|
|
298
|
+
|
|
299
|
+
1. **Development Verification** - Verify Code Interpreter core functionality
|
|
300
|
+
2. **Functional Testing** - Test various code execution scenarios
|
|
301
|
+
3. **Performance Evaluation** - Assess system performance and concurrency capability
|
|
302
|
+
4. **Learning Reference** - Serve as Code Interpreter usage examples
|
|
303
|
+
5. **Regression Testing** - Ensure functionality remains normal after updates
|
|
304
|
+
|
|
305
|
+
## 📝 Notes
|
|
306
|
+
|
|
307
|
+
1. **Dependency Requirements**: Need to install numpy, pandas, matplotlib, etc.
|
|
308
|
+
2. **Environment Configuration**: Ensure sandbox environment is properly configured
|
|
309
|
+
3. **Execution Time**: Comprehensive tests may take several minutes
|
|
310
|
+
4. **Resource Cleanup**: Automatically cleans up sandbox resources after tests complete
|
|
311
|
+
5. **Error Handling**: Some tests intentionally generate errors to verify error handling mechanisms
|
|
312
312
|
|
|
313
313
|
---
|
|
314
314
|
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
315
|
+
**Creation Date**: September 17, 2024
|
|
316
|
+
**Total Files**: 6
|
|
317
|
+
**Total Code**: 5000+ lines
|
|
318
|
+
**Test Cases**: 49
|
|
319
|
+
**Result Format Support**: 10+ formats
|
|
320
|
+
**Language Support**: Python + R language
|
|
321
|
+
**Status**: ✅ Complete and ready to use
|
|
322
322
|
|
|
323
|
-
|
|
323
|
+
All test files have been created following your required `test_sandbox` style and are ready to use! 🎉
|