EvoScientist 0.0.1.dev3__py3-none-any.whl → 0.1.0rc1__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.
Files changed (108) hide show
  1. EvoScientist/EvoScientist.py +17 -49
  2. EvoScientist/backends.py +0 -26
  3. EvoScientist/cli.py +1109 -255
  4. EvoScientist/middleware.py +8 -61
  5. EvoScientist/stream/__init__.py +0 -25
  6. EvoScientist/stream/utils.py +16 -23
  7. EvoScientist/tools.py +0 -64
  8. evoscientist-0.1.0rc1.dist-info/METADATA +199 -0
  9. evoscientist-0.1.0rc1.dist-info/RECORD +21 -0
  10. evoscientist-0.1.0rc1.dist-info/entry_points.txt +2 -0
  11. EvoScientist/memory.py +0 -715
  12. EvoScientist/paths.py +0 -45
  13. EvoScientist/skills/accelerate/SKILL.md +0 -332
  14. EvoScientist/skills/accelerate/references/custom-plugins.md +0 -453
  15. EvoScientist/skills/accelerate/references/megatron-integration.md +0 -489
  16. EvoScientist/skills/accelerate/references/performance.md +0 -525
  17. EvoScientist/skills/bitsandbytes/SKILL.md +0 -411
  18. EvoScientist/skills/bitsandbytes/references/memory-optimization.md +0 -521
  19. EvoScientist/skills/bitsandbytes/references/qlora-training.md +0 -521
  20. EvoScientist/skills/bitsandbytes/references/quantization-formats.md +0 -447
  21. EvoScientist/skills/find-skills/SKILL.md +0 -133
  22. EvoScientist/skills/find-skills/scripts/install_skill.py +0 -211
  23. EvoScientist/skills/flash-attention/SKILL.md +0 -367
  24. EvoScientist/skills/flash-attention/references/benchmarks.md +0 -215
  25. EvoScientist/skills/flash-attention/references/transformers-integration.md +0 -293
  26. EvoScientist/skills/llama-cpp/SKILL.md +0 -258
  27. EvoScientist/skills/llama-cpp/references/optimization.md +0 -89
  28. EvoScientist/skills/llama-cpp/references/quantization.md +0 -213
  29. EvoScientist/skills/llama-cpp/references/server.md +0 -125
  30. EvoScientist/skills/lm-evaluation-harness/SKILL.md +0 -490
  31. EvoScientist/skills/lm-evaluation-harness/references/api-evaluation.md +0 -490
  32. EvoScientist/skills/lm-evaluation-harness/references/benchmark-guide.md +0 -488
  33. EvoScientist/skills/lm-evaluation-harness/references/custom-tasks.md +0 -602
  34. EvoScientist/skills/lm-evaluation-harness/references/distributed-eval.md +0 -519
  35. EvoScientist/skills/ml-paper-writing/SKILL.md +0 -937
  36. EvoScientist/skills/ml-paper-writing/references/checklists.md +0 -361
  37. EvoScientist/skills/ml-paper-writing/references/citation-workflow.md +0 -562
  38. EvoScientist/skills/ml-paper-writing/references/reviewer-guidelines.md +0 -367
  39. EvoScientist/skills/ml-paper-writing/references/sources.md +0 -159
  40. EvoScientist/skills/ml-paper-writing/references/writing-guide.md +0 -476
  41. EvoScientist/skills/ml-paper-writing/templates/README.md +0 -251
  42. EvoScientist/skills/ml-paper-writing/templates/aaai2026/README.md +0 -534
  43. EvoScientist/skills/ml-paper-writing/templates/aaai2026/aaai2026-unified-supp.tex +0 -144
  44. EvoScientist/skills/ml-paper-writing/templates/aaai2026/aaai2026-unified-template.tex +0 -952
  45. EvoScientist/skills/ml-paper-writing/templates/aaai2026/aaai2026.bib +0 -111
  46. EvoScientist/skills/ml-paper-writing/templates/aaai2026/aaai2026.bst +0 -1493
  47. EvoScientist/skills/ml-paper-writing/templates/aaai2026/aaai2026.sty +0 -315
  48. EvoScientist/skills/ml-paper-writing/templates/acl/README.md +0 -50
  49. EvoScientist/skills/ml-paper-writing/templates/acl/acl.sty +0 -312
  50. EvoScientist/skills/ml-paper-writing/templates/acl/acl_latex.tex +0 -377
  51. EvoScientist/skills/ml-paper-writing/templates/acl/acl_lualatex.tex +0 -101
  52. EvoScientist/skills/ml-paper-writing/templates/acl/acl_natbib.bst +0 -1940
  53. EvoScientist/skills/ml-paper-writing/templates/acl/anthology.bib.txt +0 -26
  54. EvoScientist/skills/ml-paper-writing/templates/acl/custom.bib +0 -70
  55. EvoScientist/skills/ml-paper-writing/templates/acl/formatting.md +0 -326
  56. EvoScientist/skills/ml-paper-writing/templates/colm2025/README.md +0 -3
  57. EvoScientist/skills/ml-paper-writing/templates/colm2025/colm2025_conference.bib +0 -11
  58. EvoScientist/skills/ml-paper-writing/templates/colm2025/colm2025_conference.bst +0 -1440
  59. EvoScientist/skills/ml-paper-writing/templates/colm2025/colm2025_conference.pdf +0 -0
  60. EvoScientist/skills/ml-paper-writing/templates/colm2025/colm2025_conference.sty +0 -218
  61. EvoScientist/skills/ml-paper-writing/templates/colm2025/colm2025_conference.tex +0 -305
  62. EvoScientist/skills/ml-paper-writing/templates/colm2025/fancyhdr.sty +0 -485
  63. EvoScientist/skills/ml-paper-writing/templates/colm2025/math_commands.tex +0 -508
  64. EvoScientist/skills/ml-paper-writing/templates/colm2025/natbib.sty +0 -1246
  65. EvoScientist/skills/ml-paper-writing/templates/iclr2026/fancyhdr.sty +0 -485
  66. EvoScientist/skills/ml-paper-writing/templates/iclr2026/iclr2026_conference.bib +0 -24
  67. EvoScientist/skills/ml-paper-writing/templates/iclr2026/iclr2026_conference.bst +0 -1440
  68. EvoScientist/skills/ml-paper-writing/templates/iclr2026/iclr2026_conference.pdf +0 -0
  69. EvoScientist/skills/ml-paper-writing/templates/iclr2026/iclr2026_conference.sty +0 -246
  70. EvoScientist/skills/ml-paper-writing/templates/iclr2026/iclr2026_conference.tex +0 -414
  71. EvoScientist/skills/ml-paper-writing/templates/iclr2026/math_commands.tex +0 -508
  72. EvoScientist/skills/ml-paper-writing/templates/iclr2026/natbib.sty +0 -1246
  73. EvoScientist/skills/ml-paper-writing/templates/icml2026/algorithm.sty +0 -79
  74. EvoScientist/skills/ml-paper-writing/templates/icml2026/algorithmic.sty +0 -201
  75. EvoScientist/skills/ml-paper-writing/templates/icml2026/example_paper.bib +0 -75
  76. EvoScientist/skills/ml-paper-writing/templates/icml2026/example_paper.pdf +0 -0
  77. EvoScientist/skills/ml-paper-writing/templates/icml2026/example_paper.tex +0 -662
  78. EvoScientist/skills/ml-paper-writing/templates/icml2026/fancyhdr.sty +0 -864
  79. EvoScientist/skills/ml-paper-writing/templates/icml2026/icml2026.bst +0 -1443
  80. EvoScientist/skills/ml-paper-writing/templates/icml2026/icml2026.sty +0 -767
  81. EvoScientist/skills/ml-paper-writing/templates/icml2026/icml_numpapers.pdf +0 -0
  82. EvoScientist/skills/ml-paper-writing/templates/neurips2025/Makefile +0 -36
  83. EvoScientist/skills/ml-paper-writing/templates/neurips2025/extra_pkgs.tex +0 -53
  84. EvoScientist/skills/ml-paper-writing/templates/neurips2025/main.tex +0 -38
  85. EvoScientist/skills/ml-paper-writing/templates/neurips2025/neurips.sty +0 -382
  86. EvoScientist/skills/peft/SKILL.md +0 -431
  87. EvoScientist/skills/peft/references/advanced-usage.md +0 -514
  88. EvoScientist/skills/peft/references/troubleshooting.md +0 -480
  89. EvoScientist/skills/ray-data/SKILL.md +0 -326
  90. EvoScientist/skills/ray-data/references/integration.md +0 -82
  91. EvoScientist/skills/ray-data/references/transformations.md +0 -83
  92. EvoScientist/skills/skill-creator/LICENSE.txt +0 -202
  93. EvoScientist/skills/skill-creator/SKILL.md +0 -356
  94. EvoScientist/skills/skill-creator/references/output-patterns.md +0 -82
  95. EvoScientist/skills/skill-creator/references/workflows.md +0 -28
  96. EvoScientist/skills/skill-creator/scripts/init_skill.py +0 -303
  97. EvoScientist/skills/skill-creator/scripts/package_skill.py +0 -110
  98. EvoScientist/skills/skill-creator/scripts/quick_validate.py +0 -95
  99. EvoScientist/skills_manager.py +0 -392
  100. EvoScientist/stream/display.py +0 -604
  101. EvoScientist/stream/events.py +0 -415
  102. EvoScientist/stream/state.py +0 -343
  103. evoscientist-0.0.1.dev3.dist-info/METADATA +0 -321
  104. evoscientist-0.0.1.dev3.dist-info/RECORD +0 -113
  105. evoscientist-0.0.1.dev3.dist-info/entry_points.txt +0 -5
  106. {evoscientist-0.0.1.dev3.dist-info → evoscientist-0.1.0rc1.dist-info}/WHEEL +0 -0
  107. {evoscientist-0.0.1.dev3.dist-info → evoscientist-0.1.0rc1.dist-info}/licenses/LICENSE +0 -0
  108. {evoscientist-0.0.1.dev3.dist-info → evoscientist-0.1.0rc1.dist-info}/top_level.txt +0 -0
@@ -1,326 +0,0 @@
1
- ---
2
- name: ray-data
3
- description: Scalable data processing for ML workloads. Streaming execution across CPU/GPU, supports Parquet/CSV/JSON/images. Integrates with Ray Train, PyTorch, TensorFlow. Scales from single machine to 100s of nodes. Use for batch inference, data preprocessing, multi-modal data loading, or distributed ETL pipelines.
4
- version: 1.0.0
5
- author: Orchestra Research
6
- license: MIT
7
- tags: [Data Processing, Ray Data, Distributed Computing, ML Pipelines, Batch Inference, ETL, Scalable, Ray, PyTorch, TensorFlow]
8
- dependencies: ["ray[data]", pyarrow, pandas]
9
- ---
10
-
11
- # Ray Data - Scalable ML Data Processing
12
-
13
- Distributed data processing library for ML and AI workloads.
14
-
15
- ## When to use Ray Data
16
-
17
- **Use Ray Data when:**
18
- - Processing large datasets (>100GB) for ML training
19
- - Need distributed data preprocessing across cluster
20
- - Building batch inference pipelines
21
- - Loading multi-modal data (images, audio, video)
22
- - Scaling data processing from laptop to cluster
23
-
24
- **Key features**:
25
- - **Streaming execution**: Process data larger than memory
26
- - **GPU support**: Accelerate transforms with GPUs
27
- - **Framework integration**: PyTorch, TensorFlow, HuggingFace
28
- - **Multi-modal**: Images, Parquet, CSV, JSON, audio, video
29
-
30
- **Use alternatives instead**:
31
- - **Pandas**: Small data (<1GB) on single machine
32
- - **Dask**: Tabular data, SQL-like operations
33
- - **Spark**: Enterprise ETL, SQL queries
34
-
35
- ## Quick start
36
-
37
- ### Installation
38
-
39
- ```bash
40
- pip install -U 'ray[data]'
41
- ```
42
-
43
- ### Load and transform data
44
-
45
- ```python
46
- import ray
47
-
48
- # Read Parquet files
49
- ds = ray.data.read_parquet("s3://bucket/data/*.parquet")
50
-
51
- # Transform data (lazy execution)
52
- ds = ds.map_batches(lambda batch: {"processed": batch["text"].str.lower()})
53
-
54
- # Consume data
55
- for batch in ds.iter_batches(batch_size=100):
56
- print(batch)
57
- ```
58
-
59
- ### Integration with Ray Train
60
-
61
- ```python
62
- import ray
63
- from ray.train import ScalingConfig
64
- from ray.train.torch import TorchTrainer
65
-
66
- # Create dataset
67
- train_ds = ray.data.read_parquet("s3://bucket/train/*.parquet")
68
-
69
- def train_func(config):
70
- # Access dataset in training
71
- train_ds = ray.train.get_dataset_shard("train")
72
-
73
- for epoch in range(10):
74
- for batch in train_ds.iter_batches(batch_size=32):
75
- # Train on batch
76
- pass
77
-
78
- # Train with Ray
79
- trainer = TorchTrainer(
80
- train_func,
81
- datasets={"train": train_ds},
82
- scaling_config=ScalingConfig(num_workers=4, use_gpu=True)
83
- )
84
- trainer.fit()
85
- ```
86
-
87
- ## Reading data
88
-
89
- ### From cloud storage
90
-
91
- ```python
92
- import ray
93
-
94
- # Parquet (recommended for ML)
95
- ds = ray.data.read_parquet("s3://bucket/data/*.parquet")
96
-
97
- # CSV
98
- ds = ray.data.read_csv("s3://bucket/data/*.csv")
99
-
100
- # JSON
101
- ds = ray.data.read_json("gs://bucket/data/*.json")
102
-
103
- # Images
104
- ds = ray.data.read_images("s3://bucket/images/")
105
- ```
106
-
107
- ### From Python objects
108
-
109
- ```python
110
- # From list
111
- ds = ray.data.from_items([{"id": i, "value": i * 2} for i in range(1000)])
112
-
113
- # From range
114
- ds = ray.data.range(1000000) # Synthetic data
115
-
116
- # From pandas
117
- import pandas as pd
118
- df = pd.DataFrame({"col1": [1, 2, 3], "col2": [4, 5, 6]})
119
- ds = ray.data.from_pandas(df)
120
- ```
121
-
122
- ## Transformations
123
-
124
- ### Map batches (vectorized)
125
-
126
- ```python
127
- # Batch transformation (fast)
128
- def process_batch(batch):
129
- batch["doubled"] = batch["value"] * 2
130
- return batch
131
-
132
- ds = ds.map_batches(process_batch, batch_size=1000)
133
- ```
134
-
135
- ### Row transformations
136
-
137
- ```python
138
- # Row-by-row (slower)
139
- def process_row(row):
140
- row["squared"] = row["value"] ** 2
141
- return row
142
-
143
- ds = ds.map(process_row)
144
- ```
145
-
146
- ### Filter
147
-
148
- ```python
149
- # Filter rows
150
- ds = ds.filter(lambda row: row["value"] > 100)
151
- ```
152
-
153
- ### Group by and aggregate
154
-
155
- ```python
156
- # Group by column
157
- ds = ds.groupby("category").count()
158
-
159
- # Custom aggregation
160
- ds = ds.groupby("category").map_groups(lambda group: {"sum": group["value"].sum()})
161
- ```
162
-
163
- ## GPU-accelerated transforms
164
-
165
- ```python
166
- # Use GPU for preprocessing
167
- def preprocess_images_gpu(batch):
168
- import torch
169
- images = torch.tensor(batch["image"]).cuda()
170
- # GPU preprocessing
171
- processed = images * 255
172
- return {"processed": processed.cpu().numpy()}
173
-
174
- ds = ds.map_batches(
175
- preprocess_images_gpu,
176
- batch_size=64,
177
- num_gpus=1 # Request GPU
178
- )
179
- ```
180
-
181
- ## Writing data
182
-
183
- ```python
184
- # Write to Parquet
185
- ds.write_parquet("s3://bucket/output/")
186
-
187
- # Write to CSV
188
- ds.write_csv("output/")
189
-
190
- # Write to JSON
191
- ds.write_json("output/")
192
- ```
193
-
194
- ## Performance optimization
195
-
196
- ### Repartition
197
-
198
- ```python
199
- # Control parallelism
200
- ds = ds.repartition(100) # 100 blocks for 100-core cluster
201
- ```
202
-
203
- ### Batch size tuning
204
-
205
- ```python
206
- # Larger batches = faster vectorized ops
207
- ds.map_batches(process_fn, batch_size=10000) # vs batch_size=100
208
- ```
209
-
210
- ### Streaming execution
211
-
212
- ```python
213
- # Process data larger than memory
214
- ds = ray.data.read_parquet("s3://huge-dataset/")
215
- for batch in ds.iter_batches(batch_size=1000):
216
- process(batch) # Streamed, not loaded to memory
217
- ```
218
-
219
- ## Common patterns
220
-
221
- ### Batch inference
222
-
223
- ```python
224
- import ray
225
-
226
- # Load model
227
- def load_model():
228
- # Load once per worker
229
- return MyModel()
230
-
231
- # Inference function
232
- class BatchInference:
233
- def __init__(self):
234
- self.model = load_model()
235
-
236
- def __call__(self, batch):
237
- predictions = self.model(batch["input"])
238
- return {"prediction": predictions}
239
-
240
- # Run distributed inference
241
- ds = ray.data.read_parquet("s3://data/")
242
- predictions = ds.map_batches(BatchInference, batch_size=32, num_gpus=1)
243
- predictions.write_parquet("s3://output/")
244
- ```
245
-
246
- ### Data preprocessing pipeline
247
-
248
- ```python
249
- # Multi-step pipeline
250
- ds = (
251
- ray.data.read_parquet("s3://raw/")
252
- .map_batches(clean_data)
253
- .map_batches(tokenize)
254
- .map_batches(augment)
255
- .write_parquet("s3://processed/")
256
- )
257
- ```
258
-
259
- ## Integration with ML frameworks
260
-
261
- ### PyTorch
262
-
263
- ```python
264
- # Convert to PyTorch
265
- torch_ds = ds.to_torch(label_column="label", batch_size=32)
266
-
267
- for batch in torch_ds:
268
- # batch is dict with tensors
269
- inputs, labels = batch["features"], batch["label"]
270
- ```
271
-
272
- ### TensorFlow
273
-
274
- ```python
275
- # Convert to TensorFlow
276
- tf_ds = ds.to_tf(feature_columns=["image"], label_column="label", batch_size=32)
277
-
278
- for features, labels in tf_ds:
279
- # Train model
280
- pass
281
- ```
282
-
283
- ## Supported data formats
284
-
285
- | Format | Read | Write | Use Case |
286
- |--------|------|-------|----------|
287
- | Parquet | ✅ | ✅ | ML data (recommended) |
288
- | CSV | ✅ | ✅ | Tabular data |
289
- | JSON | ✅ | ✅ | Semi-structured |
290
- | Images | ✅ | ❌ | Computer vision |
291
- | NumPy | ✅ | ✅ | Arrays |
292
- | Pandas | ✅ | ❌ | DataFrames |
293
-
294
- ## Performance benchmarks
295
-
296
- **Scaling** (processing 100GB data):
297
- - 1 node (16 cores): ~30 minutes
298
- - 4 nodes (64 cores): ~8 minutes
299
- - 16 nodes (256 cores): ~2 minutes
300
-
301
- **GPU acceleration** (image preprocessing):
302
- - CPU only: 1,000 images/sec
303
- - 1 GPU: 5,000 images/sec
304
- - 4 GPUs: 18,000 images/sec
305
-
306
- ## Use cases
307
-
308
- **Production deployments**:
309
- - **Pinterest**: Last-mile data processing for model training
310
- - **ByteDance**: Scaling offline inference with multi-modal LLMs
311
- - **Spotify**: ML platform for batch inference
312
-
313
- ## References
314
-
315
- - **[Transformations Guide](references/transformations.md)** - Map, filter, groupby operations
316
- - **[Integration Guide](references/integration.md)** - Ray Train, PyTorch, TensorFlow
317
-
318
- ## Resources
319
-
320
- - **Docs**: https://docs.ray.io/en/latest/data/data.html
321
- - **GitHub**: https://github.com/ray-project/ray ⭐ 36,000+
322
- - **Version**: Ray 2.40.0+
323
- - **Examples**: https://docs.ray.io/en/latest/data/examples/overview.html
324
-
325
-
326
-
@@ -1,82 +0,0 @@
1
- # Ray Data Integration Guide
2
-
3
- Integration with Ray Train and ML frameworks.
4
-
5
- ## Ray Train integration
6
-
7
- ### Basic training with datasets
8
-
9
- ```python
10
- import ray
11
- from ray.train import ScalingConfig
12
- from ray.train.torch import TorchTrainer
13
-
14
- # Create datasets
15
- train_ds = ray.data.read_parquet("s3://data/train/")
16
- val_ds = ray.data.read_parquet("s3://data/val/")
17
-
18
- def train_func(config):
19
- # Get dataset shards
20
- train_ds = ray.train.get_dataset_shard("train")
21
- val_ds = ray.train.get_dataset_shard("val")
22
-
23
- for epoch in range(config["epochs"]):
24
- # Iterate over batches
25
- for batch in train_ds.iter_batches(batch_size=32):
26
- # Train on batch
27
- pass
28
-
29
- # Launch training
30
- trainer = TorchTrainer(
31
- train_func,
32
- train_loop_config={"epochs": 10},
33
- datasets={"train": train_ds, "val": val_ds},
34
- scaling_config=ScalingConfig(num_workers=4, use_gpu=True)
35
- )
36
-
37
- result = trainer.fit()
38
- ```
39
-
40
- ## PyTorch integration
41
-
42
- ### Convert to PyTorch Dataset
43
-
44
- ```python
45
- # Option 1: to_torch (recommended)
46
- torch_ds = ds.to_torch(
47
- label_column="label",
48
- batch_size=32,
49
- drop_last=True
50
- )
51
-
52
- for batch in torch_ds:
53
- inputs = batch["features"]
54
- labels = batch["label"]
55
- # Train model
56
-
57
- # Option 2: iter_torch_batches
58
- for batch in ds.iter_torch_batches(batch_size=32):
59
- # batch is dict of tensors
60
- pass
61
- ```
62
-
63
- ## TensorFlow integration
64
-
65
- ```python
66
- tf_ds = ds.to_tf(
67
- feature_columns=["image", "text"],
68
- label_column="label",
69
- batch_size=32
70
- )
71
-
72
- for features, labels in tf_ds:
73
- # Train TensorFlow model
74
- pass
75
- ```
76
-
77
- ## Best practices
78
-
79
- 1. **Shard datasets in Ray Train** - Automatic with `get_dataset_shard()`
80
- 2. **Use streaming** - Don't load entire dataset to memory
81
- 3. **Preprocess in Ray Data** - Distribute preprocessing across cluster
82
- 4. **Cache preprocessed data** - Write to Parquet, read in training
@@ -1,83 +0,0 @@
1
- # Ray Data Transformations
2
-
3
- Complete guide to data transformations in Ray Data.
4
-
5
- ## Core operations
6
-
7
- ### Map batches (vectorized)
8
-
9
- ```python
10
- # Recommended for performance
11
- def process_batch(batch):
12
- # batch is dict of numpy arrays or pandas Series
13
- batch["doubled"] = batch["value"] * 2
14
- return batch
15
-
16
- ds = ds.map_batches(process_batch, batch_size=1000)
17
- ```
18
-
19
- **Performance**: 10-100× faster than row-by-row
20
-
21
- ### Map (row-by-row)
22
-
23
- ```python
24
- # Use only when vectorization not possible
25
- def process_row(row):
26
- row["squared"] = row["value"] ** 2
27
- return row
28
-
29
- ds = ds.map(process_row)
30
- ```
31
-
32
- ### Filter
33
-
34
- ```python
35
- # Remove rows
36
- ds = ds.filter(lambda row: row["score"] > 0.5)
37
- ```
38
-
39
- ### Flat map
40
-
41
- ```python
42
- # One row → multiple rows
43
- def expand_row(row):
44
- return [{"value": row["value"] + i} for i in range(3)]
45
-
46
- ds = ds.flat_map(expand_row)
47
- ```
48
-
49
- ## GPU-accelerated transforms
50
-
51
- ```python
52
- def gpu_transform(batch):
53
- import torch
54
- data = torch.tensor(batch["data"]).cuda()
55
- # GPU processing
56
- result = data * 2
57
- return {"processed": result.cpu().numpy()}
58
-
59
- ds = ds.map_batches(gpu_transform, num_gpus=1, batch_size=64)
60
- ```
61
-
62
- ## Groupby operations
63
-
64
- ```python
65
- # Group by column
66
- grouped = ds.groupby("category")
67
-
68
- # Aggregate
69
- result = grouped.count()
70
-
71
- # Custom aggregation
72
- result = grouped.map_groups(lambda group: {
73
- "sum": group["value"].sum(),
74
- "mean": group["value"].mean()
75
- })
76
- ```
77
-
78
- ## Best practices
79
-
80
- 1. **Use map_batches over map** - 10-100× faster
81
- 2. **Tune batch_size** - Larger = faster (balance with memory)
82
- 3. **Use GPUs for heavy compute** - Image/audio preprocessing
83
- 4. **Stream large datasets** - Use iter_batches for >memory data
@@ -1,202 +0,0 @@
1
-
2
- Apache License
3
- Version 2.0, January 2004
4
- http://www.apache.org/licenses/
5
-
6
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
-
8
- 1. Definitions.
9
-
10
- "License" shall mean the terms and conditions for use, reproduction,
11
- and distribution as defined by Sections 1 through 9 of this document.
12
-
13
- "Licensor" shall mean the copyright owner or entity authorized by
14
- the copyright owner that is granting the License.
15
-
16
- "Legal Entity" shall mean the union of the acting entity and all
17
- other entities that control, are controlled by, or are under common
18
- control with that entity. For the purposes of this definition,
19
- "control" means (i) the power, direct or indirect, to cause the
20
- direction or management of such entity, whether by contract or
21
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
- outstanding shares, or (iii) beneficial ownership of such entity.
23
-
24
- "You" (or "Your") shall mean an individual or Legal Entity
25
- exercising permissions granted by this License.
26
-
27
- "Source" form shall mean the preferred form for making modifications,
28
- including but not limited to software source code, documentation
29
- source, and configuration files.
30
-
31
- "Object" form shall mean any form resulting from mechanical
32
- transformation or translation of a Source form, including but
33
- not limited to compiled object code, generated documentation,
34
- and conversions to other media types.
35
-
36
- "Work" shall mean the work of authorship, whether in Source or
37
- Object form, made available under the License, as indicated by a
38
- copyright notice that is included in or attached to the work
39
- (an example is provided in the Appendix below).
40
-
41
- "Derivative Works" shall mean any work, whether in Source or Object
42
- form, that is based on (or derived from) the Work and for which the
43
- editorial revisions, annotations, elaborations, or other modifications
44
- represent, as a whole, an original work of authorship. For the purposes
45
- of this License, Derivative Works shall not include works that remain
46
- separable from, or merely link (or bind by name) to the interfaces of,
47
- the Work and Derivative Works thereof.
48
-
49
- "Contribution" shall mean any work of authorship, including
50
- the original version of the Work and any modifications or additions
51
- to that Work or Derivative Works thereof, that is intentionally
52
- submitted to Licensor for inclusion in the Work by the copyright owner
53
- or by an individual or Legal Entity authorized to submit on behalf of
54
- the copyright owner. For the purposes of this definition, "submitted"
55
- means any form of electronic, verbal, or written communication sent
56
- to the Licensor or its representatives, including but not limited to
57
- communication on electronic mailing lists, source code control systems,
58
- and issue tracking systems that are managed by, or on behalf of, the
59
- Licensor for the purpose of discussing and improving the Work, but
60
- excluding communication that is conspicuously marked or otherwise
61
- designated in writing by the copyright owner as "Not a Contribution."
62
-
63
- "Contributor" shall mean Licensor and any individual or Legal Entity
64
- on behalf of whom a Contribution has been received by Licensor and
65
- subsequently incorporated within the Work.
66
-
67
- 2. Grant of Copyright License. Subject to the terms and conditions of
68
- this License, each Contributor hereby grants to You a perpetual,
69
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
- copyright license to reproduce, prepare Derivative Works of,
71
- publicly display, publicly perform, sublicense, and distribute the
72
- Work and such Derivative Works in Source or Object form.
73
-
74
- 3. Grant of Patent License. Subject to the terms and conditions of
75
- this License, each Contributor hereby grants to You a perpetual,
76
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
- (except as stated in this section) patent license to make, have made,
78
- use, offer to sell, sell, import, and otherwise transfer the Work,
79
- where such license applies only to those patent claims licensable
80
- by such Contributor that are necessarily infringed by their
81
- Contribution(s) alone or by combination of their Contribution(s)
82
- with the Work to which such Contribution(s) was submitted. If You
83
- institute patent litigation against any entity (including a
84
- cross-claim or counterclaim in a lawsuit) alleging that the Work
85
- or a Contribution incorporated within the Work constitutes direct
86
- or contributory patent infringement, then any patent licenses
87
- granted to You under this License for that Work shall terminate
88
- as of the date such litigation is filed.
89
-
90
- 4. Redistribution. You may reproduce and distribute copies of the
91
- Work or Derivative Works thereof in any medium, with or without
92
- modifications, and in Source or Object form, provided that You
93
- meet the following conditions:
94
-
95
- (a) You must give any other recipients of the Work or
96
- Derivative Works a copy of this License; and
97
-
98
- (b) You must cause any modified files to carry prominent notices
99
- stating that You changed the files; and
100
-
101
- (c) You must retain, in the Source form of any Derivative Works
102
- that You distribute, all copyright, patent, trademark, and
103
- attribution notices from the Source form of the Work,
104
- excluding those notices that do not pertain to any part of
105
- the Derivative Works; and
106
-
107
- (d) If the Work includes a "NOTICE" text file as part of its
108
- distribution, then any Derivative Works that You distribute must
109
- include a readable copy of the attribution notices contained
110
- within such NOTICE file, excluding those notices that do not
111
- pertain to any part of the Derivative Works, in at least one
112
- of the following places: within a NOTICE text file distributed
113
- as part of the Derivative Works; within the Source form or
114
- documentation, if provided along with the Derivative Works; or,
115
- within a display generated by the Derivative Works, if and
116
- wherever such third-party notices normally appear. The contents
117
- of the NOTICE file are for informational purposes only and
118
- do not modify the License. You may add Your own attribution
119
- notices within Derivative Works that You distribute, alongside
120
- or as an addendum to the NOTICE text from the Work, provided
121
- that such additional attribution notices cannot be construed
122
- as modifying the License.
123
-
124
- You may add Your own copyright statement to Your modifications and
125
- may provide additional or different license terms and conditions
126
- for use, reproduction, or distribution of Your modifications, or
127
- for any such Derivative Works as a whole, provided Your use,
128
- reproduction, and distribution of the Work otherwise complies with
129
- the conditions stated in this License.
130
-
131
- 5. Submission of Contributions. Unless You explicitly state otherwise,
132
- any Contribution intentionally submitted for inclusion in the Work
133
- by You to the Licensor shall be under the terms and conditions of
134
- this License, without any additional terms or conditions.
135
- Notwithstanding the above, nothing herein shall supersede or modify
136
- the terms of any separate license agreement you may have executed
137
- with Licensor regarding such Contributions.
138
-
139
- 6. Trademarks. This License does not grant permission to use the trade
140
- names, trademarks, service marks, or product names of the Licensor,
141
- except as required for reasonable and customary use in describing the
142
- origin of the Work and reproducing the content of the NOTICE file.
143
-
144
- 7. Disclaimer of Warranty. Unless required by applicable law or
145
- agreed to in writing, Licensor provides the Work (and each
146
- Contributor provides its Contributions) on an "AS IS" BASIS,
147
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
- implied, including, without limitation, any warranties or conditions
149
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
- PARTICULAR PURPOSE. You are solely responsible for determining the
151
- appropriateness of using or redistributing the Work and assume any
152
- risks associated with Your exercise of permissions under this License.
153
-
154
- 8. Limitation of Liability. In no event and under no legal theory,
155
- whether in tort (including negligence), contract, or otherwise,
156
- unless required by applicable law (such as deliberate and grossly
157
- negligent acts) or agreed to in writing, shall any Contributor be
158
- liable to You for damages, including any direct, indirect, special,
159
- incidental, or consequential damages of any character arising as a
160
- result of this License or out of the use or inability to use the
161
- Work (including but not limited to damages for loss of goodwill,
162
- work stoppage, computer failure or malfunction, or any and all
163
- other commercial damages or losses), even if such Contributor
164
- has been advised of the possibility of such damages.
165
-
166
- 9. Accepting Warranty or Additional Liability. While redistributing
167
- the Work or Derivative Works thereof, You may choose to offer,
168
- and charge a fee for, acceptance of support, warranty, indemnity,
169
- or other liability obligations and/or rights consistent with this
170
- License. However, in accepting such obligations, You may act only
171
- on Your own behalf and on Your sole responsibility, not on behalf
172
- of any other Contributor, and only if You agree to indemnify,
173
- defend, and hold each Contributor harmless for any liability
174
- incurred by, or claims asserted against, such Contributor by reason
175
- of your accepting any such warranty or additional liability.
176
-
177
- END OF TERMS AND CONDITIONS
178
-
179
- APPENDIX: How to apply the Apache License to your work.
180
-
181
- To apply the Apache License to your work, attach the following
182
- boilerplate notice, with the fields enclosed by brackets "[]"
183
- replaced with your own identifying information. (Don't include
184
- the brackets!) The text should be enclosed in the appropriate
185
- comment syntax for the file format. We also recommend that a
186
- file or class name and description of purpose be included on the
187
- same "printed page" as the copyright notice for easier
188
- identification within third-party archives.
189
-
190
- Copyright [yyyy] [name of copyright owner]
191
-
192
- Licensed under the Apache License, Version 2.0 (the "License");
193
- you may not use this file except in compliance with the License.
194
- You may obtain a copy of the License at
195
-
196
- http://www.apache.org/licenses/LICENSE-2.0
197
-
198
- Unless required by applicable law or agreed to in writing, software
199
- distributed under the License is distributed on an "AS IS" BASIS,
200
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
- See the License for the specific language governing permissions and
202
- limitations under the License.