Closed cytheria43 closed 3 years ago
Strangely the same code works for me.
The problem appears to be a user missing from your user list. The ID 13
suggests that it's not a user that got added just now and your local list did not reflect that yet.
Could you please see if pymaid.get_user_list()
returns something sensible? In my case, I get a list of 352 users and id 13
maps to somebody with first name Addy
.
(please don't post any details from the user list in your response)
Oh wait. Are you pulling from the public CATMAID instance?
I just checked the same query against https://fafb.catmaid.virtualflybrain.org/
but that too works for me.
@schlegelp yes! I'm pulling from the public CATMAID service https://fafb.catmaid.virtualflybrain.org/
.
And I found it would produce different results when change the input neuron ids.
Get the topological links from CATMAID Graph widget as reference,
when there's no link between neuron 46105 and neuron 16 ,no error happens even though a null dataframe outputs.
But when there actually exists some links between neuron 46105 and 57503 , it would always appear the same error.
Again: both of these work for me as expected. Moreover, when I pull from https://fafb.catmaid.virtualflybrain.org/
all users have been anonymised and there is only a single user called "AnonymousUser" with id 1
.
Could you please share a full minimal working example. For example, this is what I'm doing:
>>> import pymaid
>>> rm = pymaid.CatmaidInstance(server='https://fafb.catmaid.virtualflybrain.org/', api_token=None)
>>> conn = pymaid.get_connectors_between([203840],[16],directional=False)
>>> conn.head()
connector_id connector_loc node1_id ... confidence2 creator2 node2_loc
0 474311 [421266.62, 128160.97, 194720.0] 474312 ... 5 NaN [421099.47, 128249.95, 194960.0]
1 573905 [434605.5, 164921.61, 216160.0] 573904 ... 5 NaN [435825.1, 164631.62, 216120.0]
2 1482374 [434664.8, 165543.78, 215800.0] 1277055 ... 5 NaN [434900.44, 165491.66, 215880.0]
3 1666500 [436649.84, 145266.72, 210040.0] 1666499 ... 5 NaN [436473.38, 145003.86, 210040.0]
4 2873212 [437215.0, 146896.0, 221360.0] 1275576 ... 5 NaN [438710.78, 147283.06, 221440.0]
Could you please run the above code in a fresh Python session?
Also please check the output of pymaid.get_user_list()
:
>>> pymaid.get_user_list()
id login full_name first_name last_name color
0 1 AnonymousUser [0.0, 1.0, 0.0]
Actually, I realised that there was a fix for this kind of situation sitting on the Github repo but hadn't made it to PyPI yet. I've now pushed a new version 2.0.4
to PyPI. Could you update and try again please?
$ pip3 install python-catmaid -U
Quick ping whether that issue still exists?
Hi, KeyError xxx occurred when I tried to fetch all connectors between 2 sets of skeleton ids,including all pre- and post- directions.
The running code:
conn = pymaid.get_connectors_between([203840],[16],directional=False)
The KeyError:
Used the latest verison of pymaid.