Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

checks in get_latest_roots that all IDs are current #138

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ilexaquifolium
Copy link

@ilexaquifolium ilexaquifolium commented Jan 16, 2024

In some cases where a change has been made to a non-current version of the neuron, IDs that are not current IDs can be returned by get_latest_roots(). Example:

>>> client = caveclient.CAVEclient('fanc_production_mar2021')
>>> roots = client.chunkedgraph.get_latest_roots(648518346511326005)
>>> roots
array([648518346490738685, 648518346490090970, 648518346487824596,
       648518346478115029, 648518346491690920, 648518346493870449,
       648518346494682679, 648518346496428629, 648518346486444448,
       648518346467095022, 648518346504152360, 648518346494330759,
       648518346499567451])
>>> client.chunkedgraph.is_latest_roots(roots)
array([ True,  True,  True,  True,  True,  True, False,  True,  True,
       False,  True,  True,  True])

this can lead to suggest_latest_roots() also suggesting an ID that is not current:

>>> client.chunkedgraph.suggest_latest_roots(648518346511326005)
648518346494682679
>>> client.chunkedgraph.is_latest_roots(648518346494682679)
array([False])

This small alteration adds a check for these IDs and removes them.

@fcollman
Copy link
Collaborator

Thanks for this, i'm going to look into these examples to make sure that I understood what went wrong in this case. I don't want to add another round trip call that slows things down when there could be a fix applied to the backend code instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants