Skip to content

Feature: pipelines #196

Description

@schlegelp

It would be nice if there was an easy way to compose individual navis functions into a small pipeline.

Currently, the code below will require two rounds of dispatching and collecting:

# Prune skeletons 
sk = navis.prune_twigs(sk 5000, parallel=True, n_cores=60)

# Resample to 1 point per micron of cable 
sk = navis.resample_skeleton(sk, 1000, parallel=True, n_cores=60)

Instead we should dispatch once, run both functions and return a single result. Not sure whether that's possible but a syntax like this would be nice:

from navis import prune_twigs, resample_skeleton

sk = prune_twigs(sk 5000, parallel=True, n_cores=60) >> resample_skeleton(sk, 1000, parallel=True, n_cores=60)

Alternatively, we could mimick pandas' .pipe method:

sk = sk.pipe(prune_twigs, 5000, parallel=True, n_cores=60).pipe(resample_skeleton, 1000)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions