navis-org / fafbseg-py

Tools to work with the FlyWire connectome. Fully interoperable with navis.
https://fafbseg-py.readthedocs.io
GNU General Public License v3.0
13 stars 5 forks source link

l2 dotprops seems to fail when pca attributes missing for some points #9

Closed jefferis closed 2 years ago

jefferis commented 2 years ago

From R, but I think this is general now that not all PCAs are calculate https://flywire-forum.slack.com/archives/C01M4LP2Y2D/p1646955614385879

> read_l2dp('720575940619695860')
Fetching L2 vectors:   0%|          | 0/233 [00:00<?, ?it/s]/Users/jefferis/Library/r-miniconda/envs/r-reticulate/lib/python3.8/site-packages/caveclient/l2cache.py:78: UserWarning: L2Cache is in an experimental stage
  warnings.warn("L2Cache is in an experimental stage", UserWarning)
                                                                       Error in py_call_impl(callable, dots$args, dots$keywords) : 
  KeyError: 'pca'

Detailed traceback:
  File "/Users/jefferis/Library/r-miniconda/envs/r-reticulate/lib/python3.8/site-packages/fafbseg/flywire/l2.py", line 494, in l2_dotprops
    vec = np.vstack([i['pca'][0] for i in this_info])
  File "/Users/jefferis/Library/r-miniconda/envs/r-reticulate/lib/python3.8/site-packages/fafbseg/flywire/l2.py", line 494, in <listcomp>
    vec = np.vstack([i['pca'][0] for i in this_info])
schlegelp commented 2 years ago

Thanks for flagging! Fixed with 067e1ca482c7face962fe9d2a18c028d8912a4e3. Will release a new version to PyPI ~ tomorrow.

schlegelp commented 2 years ago

Published as version 1.9.0 to PyPI. Also includes the improved retrying for L2-related functions.