Token导航 LogoToken导航

Agent Skill · 研究检索

dask(Dask 并行计算)

dask 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

dask 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证信息还不明确,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 64,959。

总安装 291周安装 12GitHub Stars 9下载 95核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:dask(Dask 并行计算)
来源仓库:https://github.com/tondevrel/scientific-agent-skills
仓库路径:skills/dask
安装命令:
npx skills add https://github.com/tondevrel/scientific-agent-skills --skill dask
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/tondevrel/scientific-agent-skills --skill dask

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

dask 用于查找、检索和筛选相关信息。适用于 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果的任务。通过 npx skills add 命令从指定 GitHub 仓库安装,需结合原始 README 确认具体用法。

安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写操作。当前无底部简介内容,可参考来源仓库获取更多使用细节。

来源仓库内路径:skills/dask

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/tondevrel/scientific-agent-skills --skill dask;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

dask 怎么安装?

在终端执行 npx skills add https://github.com/tondevrel/scientific-agent-skills --skill dask。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

dask 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

dask 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

dask 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

dask 用的人多吗?

公开数据是累计安装 291 次,近一周安装 12 次,下载 95 次,GitHub 9 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

dask 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
dask

Dask 并行计算 · 本页

2919需要联网未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Dask - Scalable Parallel Computing

Dask provides high-level collections (Arrays, DataFrames, Bags) that mimic the APIs of NumPy and pandas but operate in parallel on data sets that are larger than memory.

When to Use

  • Processing datasets that don't fit in RAM (Out-of-core computing).
  • Speeding up computations by using all available CPU cores.
  • Parallelizing custom Python functions or complex workflows (dask.delayed).
  • Scaling machine learning pipelines to large clusters.
  • Handling large-scale arrays in physics, climate science, or imaging.
  • Analyzing massive log files or unstructured data (dask.bag).

Reference Documentation

Official docs: https://docs.dask.org/ Dask Examples: https://examples.dask.org/ Search patterns: dask.dataframe, dask.array, dask.delayed, client.compute, dask.distributed

Core Principles

Lazy Evaluation

Dask doesn't compute results immediately. Instead, it builds a Task Graph. Actual computation only happens when you explicitly call .compute() or .persist().

Chunks and Partitions

  • Dask Array: Composed of many small NumPy arrays called chunks.
  • Dask DataFrame: Composed of many small pandas DataFrames called partitions.

Use Dask For

CollectionAnalogyUse Case
dask.arrayNumPyLarge-scale multidimensional math.
dask.dataframepandasLarge CSV/Parquet/SQL tables.
dask.bagLists/ToolzUnstructured data (JSON, Logs).
dask.delayedFunctionsCustom parallel logic.

Do NOT Use For

  • Data that fits easily in RAM (pandas/NumPy are faster due to lower overhead).
  • Simple tasks where multiprocessing or concurrent.futures suffice.
  • Situations where low-latency response is required (Dask adds scheduling overhead).

Quick Reference

Installation

pip install "dask[complete]"

Standard Imports

import dask.array as da
import dask.dataframe as dd
from dask import delayed, compute
from dask.distributed import Client

Basic Pattern - Initializing a Local Cluster

from dask.distributed import Client

# Setup local cluster and dashboard
client = Client()
print(client.dashboard_link) # View real-time computation graph

Critical Rules

✅ DO

  • Use the Dashboard - Always monitor the Dask dashboard to find bottlenecks (red blocks = bad).
  • Chunk thoughtfully - Aim for chunk sizes of 100MB to 250MB. Too small = high overhead; too large = memory errors.
  • Prefer Parquet - Use Parquet instead of CSV for DataFrames; it supports efficient metadata and partitioning.
  • Call .persist() on reused data - If you use the same intermediate result multiple times, persist it in memory.
  • Let Dask handle the graph - Avoid calling .compute() too early; try to keep calculations lazy as long as possible.
  • Use map_partitions - For custom logic on DataFrames, use this to apply pandas functions directly to each chunk.

❌ DON'T

  • Compute too often - Every .compute() triggers the entire graph execution and pulls data into RAM.
  • Send large data to workers - Use client.scatter for large objects needed by all workers instead of passing them as arguments.
  • Iterate over rows - for row in dask_df is incredibly slow; use vectorized operations.
  • Use Dask if pandas is enough - Dask is slower for small data due to scheduling time.

Anti-Patterns (NEVER)

import dask.dataframe as dd

# ❌ BAD: Computing a large result into a local variable
# This will crash your local machine by filling RAM
result = dd_df.compute()

# ✅ GOOD: Compute only what you need (aggregations)
mean_val = dd_df['column'].mean().compute()

# ❌ BAD: Too many small tasks (Task Overhead)
# result = [delayed(inc)(i) for i in range(1000000)] # 1 million tasks is too much

# ✅ GOOD: Batch tasks together or use Dask Collections
import dask.array as da
x = da.arange(1000000, chunks=10000) # Only 100 tasks

# ❌ BAD: Hardcoding workers' file paths
# dd.read_csv('/Users/me/data.csv') # Workers on other machines can't see this path!

# ✅ GOOD: Use shared storage (S3, HDFS, NFS)
# dd.read_csv('s3://my-bucket/data.csv')

Dask Array (dask.array)

Scaling NumPy

import dask.array as da

# Create a large random array (100GB)
x = da.random.random((100000, 100000), chunks=(10000, 10000))

# Perform operations (Lazy)
y = x + x.T
z = y[::2, :5000].mean(axis=0)

# Compute result
result = z.compute()

Dask DataFrame (dask.dataframe)

Scaling pandas

import dask.dataframe as dd

# Load massive dataset
df = dd.read_csv('data/*.csv')

# Filtering and Grouping
result = (df[df['value'] > 0]
          .groupby('category')
          .amount.sum())

# Execute
final_amounts = result.compute()

# Convert from pandas to dask
import pandas as pd
pdf = pd.DataFrame(...)
ddf = dd.from_pandas(pdf, npartitions=10)

Dask Delayed (dask.delayed)

Parallelizing Custom Code

from dask import delayed

@delayed
def load(filename):
    ...
    return data

@delayed
def process(data):
    ...
    return result

@delayed
def summarize(results):
    return sum(results)

# Build graph
filenames = ['file1.csv', 'file2.csv', 'file3.csv']
outputs = [process(load(f)) for f in filenames]
total = summarize(outputs)

# Visualize graph (requires graphviz)
# total.visualize()

# Execute in parallel
final_sum = total.compute()

Machine Learning with Dask (dask-ml)

from dask_ml.preprocessing import StandardScaler
from dask_ml.linear_model import LogisticRegression
from dask_ml.model_selection import train_test_split

# Scaling to large data
scaler = StandardScaler()
X_scaled = scaler.fit_transform(X_dask)

# Training on large datasets (Parallel SGD)
model = LogisticRegression()
model.fit(X_dask, y_dask)

# Scikit-learn wrapper (for small data, parallelizing search)
from sklearn.ensemble import RandomForestClassifier
from dask_ml.model_selection import GridSearchCV

clf = RandomForestClassifier()
grid = GridSearchCV(clf, param_grid, cv=3)
grid.fit(X, y) # Grid search runs in parallel across cluster

Practical Workflows

1. Massive Log Processing (Bag)

import dask.bag as db
import json

def analyze_logs(pattern):
    # Read unstructured text files
    b = db.read_text('logs/2023-*.log')

    # Parse JSON and filter
    records = b.map(json.loads).filter(lambda x: x['level'] == 'ERROR')

    # Extract specific field and count frequencies
    counts = records.pluck('message').frequencies()

    return counts.compute()

2. Large Scale Imaging (Array)

def process_satellite_images(da_stack):
    """Calculate NDVI anomaly across time on 1TB of data."""
    # da_stack is a 3D dask array (time, x, y)

    # Simple vectorized math (Parallel)
    climatology = da_stack.mean(axis=0)
    anomaly = da_stack - climatology

    # Save results directly to disk without loading into RAM
    anomaly.to_zarr('anomalies.zarr')

3. Cleaning Data with Method Chaining

def clean_dataset(ddf):
    return (ddf
            .dropna(subset=['id'])
            .fillna({'status': 'unknown'})
            .assign(timestamp=dd.to_datetime(ddf['time_str']))
            .groupby('user_id')
            .last()
            .persist()) # Keep in memory for fast future use

Performance Optimization

The Dask Dashboard Guide

  • Progress Bar: Shows how many tasks are finished.
  • Task Stream: Shows which worker is doing what. White space = idle workers (bad).
  • Memory Plot: Shows RAM usage. If it turns orange/red, workers are hitting limits.
  • Worker Table: Check for skewed data distribution.

Optimizing Data Storage

  • Zarr: Best for N-dimensional arrays.
  • Parquet: Best for tabular DataFrames.
  • Compression: Use snappy or lz4 for a balance between speed and size.

Common Pitfalls and Solutions

The "Worker Lost" Error

Problem: Workers crash because they ran out of RAM.

Solution: Decrease chunk size or use a machine with more memory. Check for data skew.

Serialization Errors (Pickle)

Problem: Dask can't send your custom object to workers.

Solution: Use dask.distributed.Client.register_plugin or ensure classes are defined in a separate file accessible by workers.

"Too Many Tasks" Warning

Problem: You created 1,000,000+ tiny tasks.

Solution: Re-chunk your data into larger pieces. Use dask_array.rechunk() or dask_df.repartition().

Best Practices

  1. Always monitor the Dask dashboard during development to identify bottlenecks.
  2. Choose chunk sizes carefully - aim for 100-250MB per chunk for optimal performance.
  3. Use Parquet format for DataFrames instead of CSV for better performance and metadata support.
  4. Persist intermediate results that are reused multiple times to avoid recomputation.
  5. Keep computations lazy as long as possible - only call .compute() when you need the final result.
  6. Use map_partitions for custom pandas operations on Dask DataFrames.
  7. Avoid iterating over rows in Dask DataFrames - use vectorized operations instead.
  8. Use shared storage (S3, HDFS, NFS) when working with distributed clusters.
  9. Batch small tasks together to avoid task overhead.
  10. Don't use Dask for data that fits in RAM - pandas/NumPy are faster for small datasets.

Dask transforms Python from a single-threaded scripting language into a world-class system for distributed computing. It is the bridge between a researcher's laptop and a high-performance compute cluster.

平台分布

Codex

36.02%
按下载量换算34

Claude

31.33%
按下载量换算30

Cursor

19.25%
按下载量换算18

Gemini CLI

9.52%
按下载量换算9

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills