Skip to content

fetch_adjacencies() API is awkward #81

@stuarteberg

Description

@stuarteberg

To avoid a huge edge table with lots of redundant info, it returns two dataframes, separating edge data from neuron properties. But the result is annoying to deal with.

For example, to merge the properties from the pre neurons onto the edge table, you have to do something like this:

neurons, edges = fetch_adjacencies(NC(somaLocation=NotNull), targets, properties=['zapbenchId'])
neurons_pre = neurons.rename(columns={c: f"{c}_pre" for c in neurons.columns})
edges = edges.merge(neurons_pre[['bodyId_pre', 'zapbenchId_pre']], 'left', on='bodyId_pre')

It would be better to return three dataframes: neurons_pre, neurons_post, and edges.

And maybe it would be worthwhile to offer an option to pre-merge the neuron properties directly onto the edge table, assuming the results aren't too huge.


Update: Upon reflection, I think I'm okay with just breaking the API and adding a new output.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions