Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Onion-ring traverse API #18

@yzx9

Description

@yzx9
def traverse(next):
  enter = do_something() # same as the enter callback
  children = next(enter)
  leave = do_something_else(children) # same as leave the callback
  return leave

Tree.from_swc(...).traverse(traverse)

The advantage of this onion-ring API design is that users can hold a closure to easily retain some information. However, I am not quite sure if such a call would lead to a too deep call stack (in some extreme cases, a neuron may have hundreds of thousands of points).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions