界面已本地化;技能介绍与说明文档按所选语言由 AI 自动翻译,代码、命令、路径和专业术语保留原文,以原作者文档为准。
探索技能
开发与工程 · SKILL.md

flow-authoring

flow-authoring

【开发与工程】Guides authoring, checking, running, resuming, and debugging local Metaflow FlowSpec workflows with parameters, configs, files, foreach, and decorators.

独立 GitHub 快照 · 自动分类 · 以原作者文档为准

技能说明

GitHub

name: flow-authoring description: "Guides authoring, checking, running, resuming, and debugging local Metaflow FlowSpec workflows with parameters, configs, files, foreach, and decorators." disable-model-invocation: true metadata: disco-role: operating license: Apache 2.0

Flow Authoring

Use this sub-skill when the task is to create or debug a Metaflow flow script, inspect the flow graph, run locally, resume, or reason about FlowSpec, @step, self.next, parameters, configs, IncludeFile, foreach, or local step decorators.

Quick Route

Minimal Flow Pattern

from metaflow import FlowSpec, Parameter, step

class ExampleFlow(FlowSpec):
    count = Parameter("count", default=3, type=int)

    @step
    def start(self):
        self.values = list(range(self.count))
        self.next(self.work, foreach="values")

    @step
    def work(self):
        self.result = self.input * 2
        self.next(self.join)

    @step
    def join(self, inputs):
        self.results = [task.result for task in inputs]
        self.next(self.end)

    @step
    def end(self):
        print(self.results)

if __name__ == "__main__":
    ExampleFlow()

Use python flow.py --no-pylint check before run when lint dependencies are not installed. Use python flow.py version for the package version.

Boundaries

我的收藏