Skip to content

Improve documentation of gr.spatial_neighbors #1047

@grst

Description

@grst

Spatial neighbors has many different modes

  • grid vs. non grid
  • delauney vs. nearest neighbors
  • knn vs. radius-based

To me, it is not entirely clear from the docs, how the different parameters interact.

  • If I specify both n_neighs, and a radius, what takes precedence? Or are both cutoffs applied
  • If I specify both delauney and radius/n_neigh, what takes precedence?

I think this could be clearer in the docs.

Not sure if it is still an option, but an alternative could be to split up the function into multiple functions for different purposes, e.g.

gr.spatial_neighbors_grid
gr.spatial_neighbors_knn
gr.spatial_neighbors_delauney
gr.spatial_neighbors_radius

In that case, only arguments relevant to the respective methods would be in the function signature.

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