Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream' into nearest_node
Browse files Browse the repository at this point in the history
  • Loading branch information
perlman committed Oct 27, 2023
2 parents f1f45b8 + 2a452c3 commit c6219f9
Show file tree
Hide file tree
Showing 4 changed files with 381 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docs/source/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,19 @@ Functions related to searching for neurons and fetching their 3D skeletons:
pymaid.get_skeleton_change
pymaid.get_skeleton_ids


Neuron labels
^^^^^^^^^^^^^

.. autosummary::
:toctree: generated/

pymaid.neuron_label.NeuronLabeller
pymaid.neuron_label.SkeletonId
pymaid.neuron_label.NeuronName
pymaid.neuron_label.Annotations
pymaid.neuron_label.ThinNeuron

Annotations
-----------
Functions to fetch annotations:
Expand Down
4 changes: 4 additions & 0 deletions docs/source/whats_new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ What's new?
* - Version
- Date
-
* - Next
- n/a
- - :class:`pymaid.neuron_label.NeuronLabeller` added for labelling neurons
like in the CATMAID frontend.
* - 2.4.0
- 27/05/23
- - :func:`pymaid.get_annotation_graph` deprecated in favour of the new
Expand Down
14 changes: 14 additions & 0 deletions pymaid/fetch/annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,19 @@ def filter_by_query(
return filt


@cache.wipe_and_retry
def get_annotation_table(remote_instance=None):

remote_instance = utils._eval_remote_instance(remote_instance)

logger.debug("Retrieving list of annotations...")

remote_annotation_list_url = remote_instance._get_annotation_list()
an_list = remote_instance.fetch(remote_annotation_list_url)

return pd.DataFrame.from_records(an_list["annotations"])


@cache.wipe_and_retry
def get_annotation_id(
annotations, allow_partial=False, raise_not_found=True, remote_instance=None
Expand All @@ -106,6 +119,7 @@ def get_annotation_id(
``{'annotation_name': 'annotation_id', ...}``
"""
an_list = get_annotation_table()
remote_instance = utils._eval_remote_instance(remote_instance)

logger.debug("Retrieving list of annotations...")
Expand Down
Loading

0 comments on commit c6219f9

Please sign in to comment.