CAVEconnectome / CAVEclient

This is the python client for accessing REST APIs within the Connectome Annotation Versioning Engine.
https://caveconnectome.github.io/CAVEclient/
MIT License
19 stars 12 forks source link

Due to problems with lineage graph, get_latest_roots sometimes includes non-current IDs #141

Open ilexaquifolium opened 5 months ago

ilexaquifolium commented 5 months ago

https://github.com/seung-lab/CAVEclient/blob/1e4fbbcfa357ea0719c186666a5a39393a949733/caveclient/chunkedgraph.py#L1012 https://github.com/seung-lab/CAVEclient/blob/1e4fbbcfa357ea0719c186666a5a39393a949733/caveclient/chunkedgraph.py#L1024 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])

Please find my pull request for a fix