Closed schlegelp closed 3 years ago
Yes, happy to test this out but probably not for another week or two. Will update you when I have a chance to test.
Have you had a chance to take it for a spin @jasper-tms? I'm considering moving forward and merging dev
into the master
:)
Tom just 2 days ago fixed something in the catmaid API that means I can now do the uploads I want without any bugs popping up! I can get to testing pymaid 2.0 within the next few days, but please feel free to go ahead with the merge if you think it's ready and I'm happy to give feedback about what does and doesn't work for me afterward.
Just ran an upload_neuron command on a small test neuron with pre- and post-synaptic connectors, treenode tags, and connector tags, and it got most of the way through the upload but not quite all the way. Treenodes, connectors, and treenode tags got uploaded but the error below happened in the Link connectors
block:
~/.virtualenv/pymaid2/lib/python3.7/site-packages/pymaid/upload.py in upload_neuron(x, import_tags, import_annotations, import_connectors, reuse_existing_connectors, skeleton_id, neuron_id, force_id, source_id, source_project_id, source_url, source_type, remote_instance) 587 # Link connectors 588 links = [[resp['node_id_map'][n.node_id], 589 cn_map[n.connector_id], --> 590 rl_map[n.relation]] for n in x.connectors.itertuples()] 591 592 ln_resp = link_connector(links, remote_instance=remote_instance)
AttributeError: 'Pandas' object has no attribute 'relation'
It looks like in pymaid1, connectors had an attribute 'relation' but you changed the name of this field to be 'type' in pymaid2. Is that right? I changed n.relation
to n.type
and retried, and the import worked correctly.
Also looks like you changed annotations to being stored in x._annotations
instead of x.annotations
, but this wasn't accounted for in these two lines:
557 if import_annotations and 'annotations' in x.__dict__:
558 an = x.__dict__.get('annotations', [])
Changing both annotations
to _annotations
fixed this and allowed annotations to be correctly uploaded.
That's all! With those two changes, uploads work for me. Hope that helps!
Thanks! Pymaid 2.0.1 is now on master and has these bugs fixed. You can also get this version with pip3 install python-catmaid
.
Hi @jasper-tms
Since your changes are now in the master, I have also merged them into the
dev
branch. Can I perhaps ask you to switch to the dev branch and try it out? It's a major rework and while all tests pass, anything that pushes data to a server is tricky to test.The most notable changes in pymaid 0.2.0 on
dev
are:CatmaidNeuron
andCatmaidNeuronList
are now subclasses ofnavis.TreeNeuron
andnavis.NeuronList
, respectivelyprune_by_strahler
orsplit_axon_dendrite
) have been removed and you now need to use theirnavis
equivalentpython-catmaid
navis
, instances oftreenode
andtreenode_id
have been renamed tonode
andnode_id
respectivelyWould be greatly appreciated!
Thanks, Philipp