neuralset.base.Chain

pydantic model neuralset.base.Chain[source][source]

A sequence of processing steps executed in order.

A Chain groups multiple Step objects (such as Study and EventsTransform) into a single cohesive pipeline. Because a Chain is itself a Step, it can be nested inside other chains or used anywhere a Step is expected. When you call .run(), it passes the output of each step as the input to the next.

Parameters:
  • steps (list of Step or dict of str to Step) – The ordered sequence of steps to execute. Pydantic will coerce each entry from a dict (strongly recommended over instantiated objects for simplicity).

  • infra (exca.steps.Backend, optional) – Caching and execution infrastructure inherited from Step. If provided, it determines how the final output of the chain is cached (e.g. using the Cached backend) or executed remotely (e.g. via Slurm).

Examples

chain = ns.Chain(steps=[
    {"name": "MyStudy", "path": "/data",
     "infra": {"backend": "Cached", "folder": "/cache"}},
    {"name": "QueryEvents", "query": "timeline_index < 5"},
])
events = chain.run()
Fields:
requirements: tp.ClassVar[tuple[str, ...]] = ()[source]
field steps: list[Step] | OrderedDict[str, Step] [Required][source]